From b562fb5c07460cfef4e72cbdc88db668acbbb704 Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Mon, 3 May 2021 14:56:20 -0400 Subject: [PATCH 1/2] splits API specs into composible modules - splits Open API 2.0 (swagger) into client/management APIs - uses go-swaggers flatten capabilities - uses newer version of go-swagger (v0.27.0) - introduces /edge/client/v1, /edge/management/v1 - non-prefixed URLs default to /edge/client/v1 - splits some shared management/client API handlers - renames some REST models to "client" instead of "limited" - passes all apitests, fails dataflow upd test (main fails this as well) - updates generate rest script for powershell - todo: test generate rest script for bash - todo: use xweb (different branch) --- controller/apierror/api.go | 11 + controller/env/appenv.go | 46 +- .../internal/routes/api_session_api_model.go | 3 +- .../internal/routes/api_session_router.go | 10 +- .../internal/routes/authenticate_router.go | 33 +- .../routes/authenticator_api_model.go | 4 +- .../internal/routes/authenticator_router.go | 14 +- controller/internal/routes/ca_router.go | 18 +- controller/internal/routes/config_router.go | 18 +- .../internal/routes/config_type_router.go | 24 +- .../routes/current_api_session_router.go | 33 +- ...urrent_identity_authenticator_api_model.go | 10 +- .../current_identity_authenticator_router.go | 44 +- .../routes/current_identity_router.go | 89 +- controller/internal/routes/database_router.go | 10 +- .../routes/edge_router_policy_api_model.go | 3 +- .../routes/edge_router_policy_router.go | 18 +- .../internal/routes/edge_router_router.go | 22 +- controller/internal/routes/enroll_router.go | 19 +- .../internal/routes/enrollment_router.go | 8 +- .../internal/routes/geo_region_api_model.go | 61 - .../internal/routes/geo_region_router.go | 59 - .../internal/routes/identity_api_model.go | 25 +- controller/internal/routes/identity_router.go | 40 +- .../internal/routes/identity_type_router.go | 6 +- .../routes/posture_check_api_model.go | 35 +- .../internal/routes/posture_check_router.go | 14 +- .../routes/posture_check_type_api_model.go | 3 +- .../routes/posture_check_type_router.go | 6 +- .../internal/routes/posture_data_api_model.go | 21 +- .../routes/posture_response_api_model.go | 9 - .../routes/posture_response_router.go | 12 +- controller/internal/routes/protocol_router.go | 4 +- controller/internal/routes/query_options.go | 5 +- .../internal/routes/role_attributes_router.go | 8 +- ...outer_api_model.go => router_api_model.go} | 10 +- controller/internal/routes/router_router.go | 124 + .../internal/routes/service_api_model.go | 5 +- .../service_edge_router_policy_api_model.go | 14 +- .../service_edge_router_policy_router.go | 18 +- .../routes/service_policy_api_model.go | 11 +- .../internal/routes/service_policy_router.go | 20 +- controller/internal/routes/service_router.go | 166 +- .../internal/routes/session_api_model.go | 4 +- .../internal/routes/session_api_responder.go | 2 +- controller/internal/routes/session_router.go | 36 +- controller/internal/routes/spec_router.go | 61 +- controller/internal/routes/summary_router.go | 4 +- .../internal/routes/terminator_api_model.go | 34 +- .../internal/routes/terminator_router.go | 14 +- .../internal/routes/transit_router_router.go | 96 - controller/internal/routes/version_router.go | 17 +- controller/server/controller.go | 63 +- controller/versions.go | 20 +- go.mod | 2 +- go.sum | 4 +- .../detail_geo_region_parameters.go | 159 - .../geo_region/detail_geo_region_responses.go | 171 - .../geo_region/list_geo_regions_parameters.go | 226 - .../transit_router/transit_router_client.go | 295 - .../authenticate_mfa_parameters.go | 47 +- .../authenticate_mfa_responses.go | 7 +- .../authentication/authenticate_parameters.go | 49 +- .../authentication/authenticate_responses.go | 10 +- .../authentication/authentication_client.go | 31 +- ...rent_api_session_certificate_parameters.go | 47 +- ...rrent_api_session_certificate_responses.go | 10 +- .../current_api_session_client.go | 157 +- ...rent_api_session_certificate_parameters.go | 46 +- ...rrent_api_session_certificate_responses.go | 10 +- .../delete_current_api_session_parameters.go | 42 +- .../delete_current_api_session_responses.go | 7 +- ...rent_api_session_certificate_parameters.go | 46 +- ...rrent_api_session_certificate_responses.go | 10 +- ...rrent_identity_authenticator_parameters.go | 46 +- ...urrent_identity_authenticator_responses.go | 10 +- .../get_current_api_session_parameters.go | 42 +- .../get_current_api_session_responses.go | 7 +- ...ent_api_session_certificates_parameters.go | 59 +- ...rent_api_session_certificates_responses.go | 4 +- ...rent_identity_authenticators_parameters.go | 59 +- ...rrent_identity_authenticators_responses.go | 7 +- .../list_service_updates_parameters.go | 42 +- .../list_service_updates_responses.go | 7 +- ...rrent_identity_authenticator_parameters.go | 52 +- ...urrent_identity_authenticator_responses.go | 13 +- ...rrent_identity_authenticator_parameters.go | 52 +- ...urrent_identity_authenticator_responses.go | 13 +- .../create_mfa_recovery_codes_parameters.go | 47 +- .../create_mfa_recovery_codes_responses.go | 10 +- .../current_identity_client.go | 129 +- .../current_identity/delete_mfa_parameters.go | 51 +- .../current_identity/delete_mfa_responses.go | 10 +- .../current_identity/detail_mfa_parameters.go | 42 +- .../detail_mfa_qr_code_parameters.go | 42 +- .../detail_mfa_qr_code_responses.go | 5 +- .../detail_mfa_recovery_codes_parameters.go | 51 +- .../detail_mfa_recovery_codes_responses.go | 10 +- .../current_identity/detail_mfa_responses.go | 10 +- .../current_identity/enroll_mfa_parameters.go | 42 +- .../current_identity/enroll_mfa_responses.go | 10 +- ...urrent_identity_edge_routers_parameters.go | 42 +- ...current_identity_edge_routers_responses.go | 7 +- .../get_current_identity_parameters.go | 42 +- .../get_current_identity_responses.go | 7 +- .../current_identity/verify_mfa_parameters.go | 47 +- .../current_identity/verify_mfa_responses.go | 10 +- .../enroll/enroll_ca_parameters.go | 42 +- .../enroll/enroll_ca_responses.go | 7 +- .../enroll/enroll_client.go | 101 +- .../enroll/enroll_er_ott_parameters.go | 47 +- .../enroll/enroll_er_ott_responses.go | 4 +- .../enroll/enroll_ott_ca_parameters.go | 47 +- .../enroll/enroll_ott_ca_responses.go | 4 +- .../enroll/enroll_ott_parameters.go | 47 +- .../enroll/enroll_ott_responses.go | 7 +- .../enroll/enroll_parameters.go | 49 +- .../enroll/enroll_responses.go | 7 +- .../enroll/ernoll_updb_parameters.go | 47 +- .../enroll/ernoll_updb_responses.go | 7 +- .../extend_router_enrollment_parameters.go | 45 +- .../extend_router_enrollment_responses.go | 7 +- .../detail_spec_body_parameters.go | 46 +- .../detail_spec_body_responses.go | 4 +- .../informational/detail_spec_parameters.go | 46 +- .../informational/detail_spec_responses.go | 4 +- .../informational/informational_client.go | 309 + .../list_protocols_parameters.go | 42 +- .../informational/list_protocols_responses.go | 4 +- .../informational/list_root_parameters.go | 42 +- .../informational/list_root_responses.go | 4 +- .../informational/list_specs_parameters.go | 42 +- .../informational/list_specs_responses.go | 4 +- .../informational/list_version_parameters.go | 42 +- .../informational/list_version_responses.go | 4 +- ...create_posture_response_bulk_parameters.go | 47 +- .../create_posture_response_bulk_responses.go | 10 +- .../create_posture_response_parameters.go | 47 +- .../create_posture_response_responses.go | 10 +- .../posture_checks/posture_checks_client.go | 149 + .../service/delete_service_parameters.go | 46 +- .../service/delete_service_responses.go | 13 +- .../service/detail_service_parameters.go | 46 +- .../service/detail_service_responses.go | 10 +- .../list_service_terminators_parameters.go | 64 +- .../list_service_terminators_responses.go | 129 + .../service/list_services_parameters.go | 98 +- .../service/list_services_responses.go | 7 +- .../service/patch_service_parameters.go | 52 +- .../service/patch_service_responses.go | 13 +- .../service/service_client.go | 323 + .../service/update_service_parameters.go | 52 +- .../service/update_service_responses.go | 13 +- .../session/create_session_parameters.go | 47 +- .../session/create_session_responses.go | 10 +- .../session/delete_session_parameters.go | 46 +- .../session/delete_session_responses.go | 13 +- .../session/detail_session_parameters.go | 46 +- .../session/detail_session_responses.go | 10 +- .../session/list_sessions_parameters.go | 59 +- .../session/list_sessions_responses.go | 7 +- .../session/session_client.go | 239 + .../list_well_known_cas_parameters.go | 42 +- .../list_well_known_cas_responses.go | 4 +- .../well_known/well_known_client.go | 17 +- .../ziti_edge_client_client.go | 176 + .../configure_ziti_edge_client.go | 377 + .../doc.go | 9 +- rest_client_api_server/embedded_spec.go | 10579 +++++ .../operations/authentication/authenticate.go | 6 +- .../authentication/authenticate_mfa.go | 10 +- .../authenticate_mfa_parameters.go | 10 +- .../authenticate_mfa_responses.go | 0 .../authenticate_mfa_urlbuilder.go | 2 +- .../authentication/authenticate_parameters.go | 13 +- .../authentication/authenticate_responses.go | 0 .../authentication/authenticate_urlbuilder.go | 2 +- .../create_current_api_session_certificate.go | 10 +- ...rent_api_session_certificate_parameters.go | 10 +- ...rrent_api_session_certificate_responses.go | 0 ...rent_api_session_certificate_urlbuilder.go | 2 +- .../delete_current_api_session.go | 10 +- .../delete_current_api_session_certificate.go | 10 +- ...rent_api_session_certificate_parameters.go | 5 +- ...rrent_api_session_certificate_responses.go | 0 ...rent_api_session_certificate_urlbuilder.go | 2 +- .../delete_current_api_session_parameters.go | 3 +- .../delete_current_api_session_responses.go | 0 .../delete_current_api_session_urlbuilder.go | 2 +- .../detail_current_api_session_certificate.go | 10 +- ...rent_api_session_certificate_parameters.go | 5 +- ...rrent_api_session_certificate_responses.go | 0 ...rent_api_session_certificate_urlbuilder.go | 2 +- .../detail_current_identity_authenticator.go | 10 +- ...rrent_identity_authenticator_parameters.go | 5 +- ...urrent_identity_authenticator_responses.go | 0 ...rrent_identity_authenticator_urlbuilder.go | 2 +- .../get_current_api_session.go | 10 +- .../get_current_api_session_parameters.go | 3 +- .../get_current_api_session_responses.go | 0 .../get_current_api_session_urlbuilder.go | 2 +- .../list_current_api_session_certificates.go | 10 +- ...ent_api_session_certificates_parameters.go | 8 +- ...rent_api_session_certificates_responses.go | 0 ...ent_api_session_certificates_urlbuilder.go | 2 +- .../list_current_identity_authenticators.go | 10 +- ...rent_identity_authenticators_parameters.go | 8 +- ...rrent_identity_authenticators_responses.go | 0 ...rent_identity_authenticators_urlbuilder.go | 2 +- .../list_service_updates.go | 10 +- .../list_service_updates_parameters.go | 3 +- .../list_service_updates_responses.go | 0 .../list_service_updates_urlbuilder.go | 2 +- .../patch_current_identity_authenticator.go | 10 +- ...rrent_identity_authenticator_parameters.go | 13 +- ...urrent_identity_authenticator_responses.go | 0 ...rrent_identity_authenticator_urlbuilder.go | 2 +- .../update_current_identity_authenticator.go | 10 +- ...rrent_identity_authenticator_parameters.go | 13 +- ...urrent_identity_authenticator_responses.go | 0 ...rrent_identity_authenticator_urlbuilder.go | 2 +- .../create_mfa_recovery_codes.go | 10 +- .../create_mfa_recovery_codes_parameters.go | 10 +- .../create_mfa_recovery_codes_responses.go | 0 .../create_mfa_recovery_codes_urlbuilder.go | 2 +- .../operations/current_identity/delete_mfa.go | 10 +- .../current_identity/delete_mfa_parameters.go | 11 +- .../current_identity/delete_mfa_responses.go | 0 .../current_identity/delete_mfa_urlbuilder.go | 2 +- .../operations/current_identity/detail_mfa.go | 10 +- .../current_identity/detail_mfa_parameters.go | 3 +- .../current_identity/detail_mfa_qr_code.go | 10 +- .../detail_mfa_qr_code_parameters.go | 3 +- .../detail_mfa_qr_code_responses.go | 0 .../detail_mfa_qr_code_urlbuilder.go | 2 +- .../detail_mfa_recovery_codes.go | 10 +- .../detail_mfa_recovery_codes_parameters.go | 11 +- .../detail_mfa_recovery_codes_responses.go | 0 .../detail_mfa_recovery_codes_urlbuilder.go | 2 +- .../current_identity/detail_mfa_responses.go | 0 .../current_identity/detail_mfa_urlbuilder.go | 2 +- .../operations/current_identity/enroll_mfa.go | 10 +- .../current_identity/enroll_mfa_parameters.go | 3 +- .../current_identity/enroll_mfa_responses.go | 0 .../current_identity/enroll_mfa_urlbuilder.go | 2 +- .../current_identity/get_current_identity.go | 10 +- .../get_current_identity_edge_routers.go | 10 +- ...urrent_identity_edge_routers_parameters.go | 3 +- ...current_identity_edge_routers_responses.go | 0 ...urrent_identity_edge_routers_urlbuilder.go | 2 +- .../get_current_identity_parameters.go | 3 +- .../get_current_identity_responses.go | 0 .../get_current_identity_urlbuilder.go | 2 +- .../operations/current_identity/verify_mfa.go | 10 +- .../current_identity/verify_mfa_parameters.go | 10 +- .../current_identity/verify_mfa_responses.go | 0 .../current_identity/verify_mfa_urlbuilder.go | 2 +- .../operations/enroll/enroll.go | 6 +- .../operations/enroll/enroll_ca.go | 6 +- .../operations/enroll/enroll_ca_parameters.go | 3 +- .../operations/enroll/enroll_ca_responses.go | 0 .../operations/enroll/enroll_ca_urlbuilder.go | 2 +- .../operations/enroll/enroll_er_ott.go | 6 +- .../enroll/enroll_er_ott_parameters.go | 5 +- .../enroll/enroll_er_ott_responses.go | 0 .../enroll/enroll_er_ott_urlbuilder.go | 2 +- .../operations/enroll/enroll_ott.go | 6 +- .../operations/enroll/enroll_ott_ca.go | 6 +- .../enroll/enroll_ott_ca_parameters.go | 5 +- .../enroll/enroll_ott_ca_responses.go | 0 .../enroll/enroll_ott_ca_urlbuilder.go | 2 +- .../enroll/enroll_ott_parameters.go | 5 +- .../operations/enroll/enroll_ott_responses.go | 0 .../enroll/enroll_ott_urlbuilder.go | 2 +- .../operations/enroll/enroll_parameters.go | 5 +- .../operations/enroll/enroll_responses.go | 0 .../operations/enroll/enroll_urlbuilder.go | 2 +- .../operations/enroll/ernoll_updb.go | 6 +- .../enroll/ernoll_updb_parameters.go | 5 +- .../enroll/ernoll_updb_responses.go | 0 .../enroll/ernoll_updb_urlbuilder.go | 2 +- .../enroll/extend_router_enrollment.go | 6 +- .../extend_router_enrollment_parameters.go | 10 +- .../extend_router_enrollment_responses.go | 0 .../extend_router_enrollment_urlbuilder.go | 2 +- .../operations/informational/detail_spec.go | 6 +- .../informational/detail_spec_body.go | 6 +- .../detail_spec_body_parameters.go | 5 +- .../detail_spec_body_responses.go | 0 .../detail_spec_body_urlbuilder.go | 2 +- .../informational/detail_spec_parameters.go | 5 +- .../informational/detail_spec_responses.go | 0 .../informational/detail_spec_urlbuilder.go | 2 +- .../informational/list_protocols.go | 6 +- .../list_protocols_parameters.go | 3 +- .../informational/list_protocols_responses.go | 0 .../list_protocols_urlbuilder.go | 2 +- .../operations/informational/list_root.go | 6 +- .../informational/list_root_parameters.go | 3 +- .../informational/list_root_responses.go | 0 .../informational/list_root_urlbuilder.go | 2 +- .../operations/informational/list_specs.go | 6 +- .../informational/list_specs_parameters.go | 3 +- .../informational/list_specs_responses.go | 0 .../informational/list_specs_urlbuilder.go | 2 +- .../operations/informational/list_version.go | 6 +- .../informational/list_version_parameters.go | 3 +- .../informational/list_version_responses.go | 0 .../informational/list_version_urlbuilder.go | 2 +- .../posture_checks/create_posture_response.go | 10 +- .../create_posture_response_bulk.go | 10 +- ...create_posture_response_bulk_parameters.go | 5 +- .../create_posture_response_bulk_responses.go | 0 ...create_posture_response_bulk_urlbuilder.go | 2 +- .../create_posture_response_parameters.go | 10 +- .../create_posture_response_responses.go | 0 .../create_posture_response_urlbuilder.go | 2 +- .../operations/service/delete_service.go | 10 +- .../service/delete_service_parameters.go | 5 +- .../service/delete_service_responses.go | 0 .../service/delete_service_urlbuilder.go | 2 +- .../operations/service/detail_service.go | 10 +- .../service/detail_service_parameters.go | 5 +- .../service/detail_service_responses.go | 0 .../service/detail_service_urlbuilder.go | 2 +- .../service/list_service_terminators.go | 10 +- .../list_service_terminators_parameters.go | 9 +- .../list_service_terminators_responses.go | 126 + .../list_service_terminators_urlbuilder.go | 2 +- .../operations/service/list_services.go | 10 +- .../service/list_services_parameters.go | 12 +- .../service/list_services_responses.go | 0 .../service/list_services_urlbuilder.go | 2 +- .../operations/service/patch_service.go | 10 +- .../service/patch_service_parameters.go | 11 +- .../service/patch_service_responses.go | 0 .../service/patch_service_urlbuilder.go | 2 +- .../operations/service/update_service.go | 10 +- .../service/update_service_parameters.go | 11 +- .../service/update_service_responses.go | 0 .../service/update_service_urlbuilder.go | 2 +- .../operations/session/create_session.go | 12 +- .../session/create_session_parameters.go | 10 +- .../session/create_session_responses.go | 0 .../session/create_session_urlbuilder.go | 2 +- .../operations/session/delete_session.go | 95 + .../session/delete_session_parameters.go | 5 +- .../session/delete_session_responses.go | 0 .../session/delete_session_urlbuilder.go | 2 +- .../operations/session/detail_session.go | 95 + .../session/detail_session_parameters.go | 5 +- .../session/detail_session_responses.go | 0 .../session/detail_session_urlbuilder.go | 2 +- .../operations/session/list_sessions.go | 99 + .../session/list_sessions_parameters.go | 8 +- .../session/list_sessions_responses.go | 0 .../session/list_sessions_urlbuilder.go | 2 +- .../well_known/list_well_known_cas.go | 6 +- .../list_well_known_cas_parameters.go | 3 +- .../list_well_known_cas_responses.go | 0 .../list_well_known_cas_urlbuilder.go | 2 +- .../operations/ziti_edge_client_api.go | 1011 + .../server.go | 28 +- .../api_session/api_session_client.go | 45 +- .../delete_api_sessions_parameters.go | 46 +- .../delete_api_sessions_responses.go | 10 +- .../detail_api_sessions_parameters.go | 46 +- .../detail_api_sessions_responses.go | 10 +- .../list_api_sessions_parameters.go | 59 +- .../list_api_sessions_responses.go | 4 +- .../authenticate_mfa_parameters.go | 175 + .../authenticate_mfa_responses.go | 129 + .../authentication/authenticate_parameters.go | 196 + .../authentication/authenticate_responses.go | 167 + .../authentication/authentication_client.go | 76 +- .../authenticator/authenticator_client.go | 87 +- .../create_authenticator_parameters.go | 47 +- .../create_authenticator_responses.go | 10 +- .../delete_authenticator_parameters.go | 46 +- .../delete_authenticator_responses.go | 10 +- .../detail_authenticator_parameters.go | 46 +- .../detail_authenticator_responses.go | 10 +- .../list_authenticators_parameters.go | 42 +- .../list_authenticators_responses.go | 4 +- .../patch_authenticator_parameters.go | 52 +- .../patch_authenticator_responses.go | 13 +- .../update_authenticator_parameters.go | 52 +- .../update_authenticator_responses.go | 13 +- .../certificate_authority_client.go | 115 +- .../create_ca_parameters.go | 47 +- .../create_ca_responses.go | 10 +- .../delete_ca_parameters.go | 46 +- .../delete_ca_responses.go | 10 +- .../detail_ca_parameters.go | 46 +- .../detail_ca_responses.go | 10 +- .../get_ca_jwt_parameters.go | 46 +- .../get_ca_jwt_responses.go | 10 +- .../list_cas_parameters.go | 59 +- .../list_cas_responses.go | 4 +- .../patch_ca_parameters.go | 52 +- .../patch_ca_responses.go | 13 +- .../update_ca_parameters.go | 52 +- .../update_ca_responses.go | 13 +- .../verify_ca_parameters.go | 52 +- .../verify_ca_responses.go | 13 +- .../config/config_client.go | 185 +- .../config/create_config_parameters.go | 47 +- .../config/create_config_responses.go | 10 +- .../config/create_config_type_parameters.go | 47 +- .../config/create_config_type_responses.go | 10 +- .../config/delete_config_parameters.go | 46 +- .../config/delete_config_responses.go | 13 +- .../config/delete_config_type_parameters.go | 46 +- .../config/delete_config_type_responses.go | 13 +- .../config/detail_config_parameters.go | 46 +- .../config/detail_config_responses.go | 10 +- .../config/detail_config_type_parameters.go | 46 +- .../config/detail_config_type_responses.go | 10 +- .../config/list_config_types_parameters.go | 59 +- .../config/list_config_types_responses.go | 4 +- ...list_configs_for_config_type_parameters.go | 46 +- .../list_configs_for_config_type_responses.go | 4 +- .../config/list_configs_parameters.go | 59 +- .../config/list_configs_responses.go | 7 +- .../config/patch_config_parameters.go | 52 +- .../config/patch_config_responses.go | 13 +- .../config/patch_config_type_parameters.go | 52 +- .../config/patch_config_type_responses.go | 13 +- .../config/update_config_parameters.go | 52 +- .../config/update_config_responses.go | 13 +- .../config/update_config_type_parameters.go | 52 +- .../config/update_config_type_responses.go | 13 +- .../current_api_session_client.go | 325 + .../delete_current_api_session_parameters.go | 150 + .../delete_current_api_session_responses.go | 129 + ...rrent_identity_authenticator_parameters.go | 173 + ...urrent_identity_authenticator_responses.go | 167 + .../get_current_api_session_parameters.go | 150 + .../get_current_api_session_responses.go | 129 + ...rent_identity_authenticators_parameters.go | 245 + ...rrent_identity_authenticators_responses.go | 129 + ...rrent_identity_authenticator_parameters.go | 197 + ...urrent_identity_authenticator_responses.go | 205 + ...rrent_identity_authenticator_parameters.go | 197 + ...urrent_identity_authenticator_responses.go | 205 + .../create_mfa_recovery_codes_parameters.go | 175 + .../create_mfa_recovery_codes_responses.go | 167 + .../current_identity_client.go | 414 + .../current_identity/delete_mfa_parameters.go | 197 + .../current_identity/delete_mfa_responses.go | 167 + .../current_identity/detail_mfa_parameters.go | 150 + .../detail_mfa_qr_code_parameters.go | 150 + .../detail_mfa_qr_code_responses.go | 104 + .../detail_mfa_recovery_codes_parameters.go | 197 + .../detail_mfa_recovery_codes_responses.go | 167 + .../current_identity/detail_mfa_responses.go | 167 + .../current_identity/enroll_mfa_parameters.go | 150 + .../current_identity/enroll_mfa_responses.go | 167 + .../get_current_identity_parameters.go | 150 + .../get_current_identity_responses.go | 129 + .../current_identity/verify_mfa_parameters.go | 175 + .../current_identity/verify_mfa_responses.go | 167 + .../check_data_integrity_parameters.go | 42 +- .../check_data_integrity_responses.go | 10 +- .../create_database_snapshot_parameters.go | 42 +- .../create_database_snapshot_responses.go | 10 +- .../data_integrity_results_parameters.go | 42 +- .../data_integrity_results_responses.go | 7 +- .../database/database_client.go | 59 +- .../database/fix_data_integrity_parameters.go | 42 +- .../database/fix_data_integrity_responses.go | 10 +- .../create_edge_router_parameters.go | 47 +- .../create_edge_router_responses.go | 10 +- .../delete_edge_router_parameters.go | 46 +- .../delete_edge_router_responses.go | 13 +- .../detail_edge_router_parameters.go | 46 +- .../detail_edge_router_responses.go | 10 +- .../edge_router/edge_router_client.go | 143 +- ..._router_edge_router_policies_parameters.go | 46 +- ...e_router_edge_router_policies_responses.go | 10 +- .../list_edge_router_identities_parameters.go | 46 +- .../list_edge_router_identities_responses.go | 10 +- ...service_edge_router_policies_parameters.go | 46 +- ..._service_edge_router_policies_responses.go | 10 +- .../list_edge_router_services_parameters.go | 46 +- .../list_edge_router_services_responses.go | 10 +- .../list_edge_routers_parameters.go | 98 +- .../list_edge_routers_responses.go | 7 +- .../patch_edge_router_parameters.go | 52 +- .../patch_edge_router_responses.go | 13 +- .../update_edge_router_parameters.go | 52 +- .../update_edge_router_responses.go | 13 +- .../create_edge_router_policy_parameters.go | 47 +- .../create_edge_router_policy_responses.go | 10 +- .../delete_edge_router_policy_parameters.go | 46 +- .../delete_edge_router_policy_responses.go | 13 +- .../detail_edge_router_policy_parameters.go | 46 +- .../detail_edge_router_policy_responses.go | 10 +- .../edge_router_policy_client.go | 115 +- .../list_edge_router_policies_parameters.go | 59 +- .../list_edge_router_policies_responses.go | 7 +- ...e_router_policy_edge_routers_parameters.go | 46 +- ...ge_router_policy_edge_routers_responses.go | 10 +- ...dge_router_policy_identities_parameters.go | 46 +- ...edge_router_policy_identities_responses.go | 10 +- .../patch_edge_router_policy_parameters.go | 52 +- .../patch_edge_router_policy_responses.go | 13 +- .../update_edge_router_policy_parameters.go | 52 +- .../update_edge_router_policy_responses.go | 13 +- .../delete_enrollment_parameters.go | 46 +- .../enrollment/delete_enrollment_responses.go | 10 +- .../detail_enrollment_parameters.go | 46 +- .../enrollment/detail_enrollment_responses.go | 10 +- .../enrollment/enrollment_client.go | 45 +- .../enrollment/list_enrollments_parameters.go | 59 +- .../enrollment/list_enrollments_responses.go | 7 +- ...te_identitys_service_configs_parameters.go | 52 +- ...ate_identitys_service_configs_responses.go | 13 +- .../identity/create_identity_parameters.go | 47 +- .../identity/create_identity_responses.go | 10 +- .../identity/delete_identity_parameters.go | 46 +- .../identity/delete_identity_responses.go | 13 +- .../identity/detail_identity_parameters.go | 46 +- .../identity/detail_identity_responses.go | 10 +- .../detail_identity_type_parameters.go | 46 +- .../detail_identity_type_responses.go | 10 +- ...te_identitys_service_configs_parameters.go | 52 +- ...ate_identitys_service_configs_responses.go | 13 +- ...tity_failed_service_requests_parameters.go | 46 +- ...ntity_failed_service_requests_responses.go | 16 +- .../get_identity_policy_advice_parameters.go | 51 +- .../get_identity_policy_advice_responses.go | 10 +- .../get_identity_posture_data_parameters.go | 46 +- .../get_identity_posture_data_responses.go | 16 +- .../identity/identity_client.go | 271 +- .../identity/list_identities_parameters.go | 98 +- .../identity/list_identities_responses.go | 7 +- .../list_identity_edge_routers_parameters.go | 46 +- .../list_identity_edge_routers_responses.go | 10 +- ...st_identity_service_policies_parameters.go | 46 +- ...ist_identity_service_policies_responses.go | 10 +- .../list_identity_services_parameters.go | 46 +- .../list_identity_services_responses.go | 10 +- .../list_identity_types_parameters.go | 59 +- .../identity/list_identity_types_responses.go | 7 +- ...entitys_edge_router_policies_parameters.go | 46 +- ...dentitys_edge_router_policies_responses.go | 10 +- ...st_identitys_service_configs_parameters.go | 46 +- ...ist_identitys_service_configs_responses.go | 10 +- .../identity/patch_identity_parameters.go | 52 +- .../identity/patch_identity_responses.go | 13 +- .../remove_identity_mfa_parameters.go | 46 +- .../identity/remove_identity_mfa_responses.go | 10 +- .../identity/update_identity_parameters.go | 52 +- .../identity/update_identity_responses.go | 13 +- .../detail_spec_body_parameters.go | 173 + .../detail_spec_body_responses.go | 91 + .../informational/detail_spec_parameters.go | 173 + .../informational/detail_spec_responses.go | 91 + .../informational/informational_client.go | 123 +- .../informational/list_root_parameters.go | 150 + .../informational/list_root_responses.go | 91 + .../informational/list_specs_parameters.go | 150 + .../informational/list_specs_responses.go | 91 + .../informational/list_summary_parameters.go | 42 +- .../informational/list_summary_responses.go | 7 +- .../informational/list_version_parameters.go | 150 + .../informational/list_version_responses.go | 91 + .../create_posture_check_parameters.go | 47 +- .../create_posture_check_responses.go | 10 +- .../delete_posture_check_parameters.go | 46 +- .../delete_posture_check_responses.go | 10 +- .../detail_posture_check_parameters.go | 46 +- .../detail_posture_check_responses.go | 10 +- .../detail_posture_check_type_parameters.go | 46 +- .../detail_posture_check_type_responses.go | 10 +- .../list_posture_check_types_parameters.go | 59 +- .../list_posture_check_types_responses.go | 4 +- .../list_posture_checks_parameters.go | 98 +- .../list_posture_checks_responses.go | 4 +- .../patch_posture_check_parameters.go | 52 +- .../patch_posture_check_responses.go | 13 +- .../posture_checks/posture_checks_client.go | 193 +- .../update_posture_check_parameters.go | 52 +- .../update_posture_check_responses.go | 13 +- ..._edge_router_role_attributes_parameters.go | 59 +- ...t_edge_router_role_attributes_responses.go | 7 +- ...ist_identity_role_attributes_parameters.go | 59 +- ...list_identity_role_attributes_responses.go | 7 +- ...list_service_role_attributes_parameters.go | 59 +- .../list_service_role_attributes_responses.go | 7 +- .../role_attributes/role_attributes_client.go | 45 +- .../router/create_router_parameters.go | 175 + .../router/create_router_responses.go | 167 + .../create_transit_router_parameters.go | 55 +- .../create_transit_router_responses.go | 12 +- .../router/delete_router_parameters.go | 173 + .../router/delete_router_responses.go | 205 + .../delete_transit_router_parameters.go | 48 +- .../delete_transit_router_responses.go | 15 +- .../router/detail_router_parameters.go | 173 + .../router/detail_router_responses.go | 167 + .../detail_transit_router_parameters.go | 48 +- .../detail_transit_router_responses.go | 20 +- .../router/list_routers_parameters.go | 245 + .../router/list_routers_responses.go | 129 + .../list_transit_routers_parameters.go | 61 +- .../router}/list_transit_routers_responses.go | 15 +- .../router/patch_router_parameters.go | 197 + .../router/patch_router_responses.go | 205 + .../patch_transit_router_parameters.go | 60 +- .../router}/patch_transit_router_responses.go | 15 +- .../router/router_client.go | 581 + .../router/update_router_parameters.go | 197 + .../router/update_router_responses.go | 205 + .../update_transit_router_parameters.go | 60 +- .../update_transit_router_responses.go | 15 +- .../service/create_service_parameters.go | 47 +- .../service/create_service_responses.go | 10 +- .../service/delete_service_parameters.go | 173 + .../service/delete_service_responses.go | 205 + .../service/detail_service_parameters.go | 173 + .../service/detail_service_responses.go | 167 + .../service/list_service_config_parameters.go | 64 +- .../service/list_service_config_responses.go | 7 +- .../list_service_edge_routers_parameters.go | 64 +- .../list_service_edge_routers_responses.go | 7 +- .../list_service_identities_parameters.go | 64 +- .../list_service_identities_responses.go | 7 +- ...service_edge_router_policies_parameters.go | 64 +- ..._service_edge_router_policies_responses.go | 7 +- ...ist_service_service_policies_parameters.go | 64 +- ...list_service_service_policies_responses.go | 7 +- .../list_service_terminators_parameters.go | 267 + .../list_service_terminators_responses.go | 7 +- .../service/list_services_parameters.go | 318 + .../service/list_services_responses.go | 57 +- .../service/patch_service_parameters.go | 197 + .../service/patch_service_responses.go | 205 + .../service/service_client.go | 171 +- .../service/update_service_parameters.go | 197 + .../service/update_service_responses.go | 205 + ...e_service_edge_router_policy_parameters.go | 47 +- ...te_service_edge_router_policy_responses.go | 10 +- ...e_service_edge_router_policy_parameters.go | 46 +- ...te_service_edge_router_policy_responses.go | 13 +- ...l_service_edge_router_policy_parameters.go | 46 +- ...il_service_edge_router_policy_responses.go | 10 +- ...service_edge_router_policies_parameters.go | 59 +- ..._service_edge_router_policies_responses.go | 7 +- ...e_router_policy_edge_routers_parameters.go | 46 +- ...ge_router_policy_edge_routers_responses.go | 10 +- ..._edge_router_policy_services_parameters.go | 46 +- ...e_edge_router_policy_services_responses.go | 10 +- ...h_service_edge_router_policy_parameters.go | 52 +- ...ch_service_edge_router_policy_responses.go | 13 +- .../service_edge_router_policy_client.go | 115 +- ...e_service_edge_router_policy_parameters.go | 52 +- ...te_service_edge_router_policy_responses.go | 13 +- .../create_service_policy_parameters.go | 47 +- .../create_service_policy_responses.go | 10 +- .../delete_service_policy_parameters.go | 46 +- .../delete_service_policy_responses.go | 13 +- .../detail_service_policy_parameters.go | 46 +- .../detail_service_policy_responses.go | 10 +- .../list_service_policies_parameters.go | 59 +- .../list_service_policies_responses.go | 7 +- ...st_service_policy_identities_parameters.go | 64 +- ...ist_service_policy_identities_responses.go | 10 +- ...ervice_policy_posture_checks_parameters.go | 64 +- ...service_policy_posture_checks_responses.go | 10 +- ...list_service_policy_services_parameters.go | 64 +- .../list_service_policy_services_responses.go | 10 +- .../patch_service_policy_parameters.go | 52 +- .../patch_service_policy_responses.go | 13 +- .../service_policy/service_policy_client.go | 129 +- .../update_service_policy_parameters.go | 52 +- .../update_service_policy_responses.go | 13 +- .../session/delete_session_parameters.go | 173 + .../session/delete_session_responses.go | 205 + .../session/detail_session_parameters.go | 173 + .../session/detail_session_responses.go | 167 + .../detail_session_route_path_parameters.go | 46 +- .../detail_session_route_path_responses.go | 10 +- .../session/list_sessions_parameters.go | 245 + .../session/list_sessions_responses.go | 129 + .../session/session_client.go | 98 +- .../create_terminator_parameters.go | 47 +- .../terminator/create_terminator_responses.go | 10 +- .../delete_terminator_parameters.go | 46 +- .../terminator/delete_terminator_responses.go | 13 +- .../detail_terminator_parameters.go | 46 +- .../terminator/detail_terminator_responses.go | 10 +- .../terminator/list_terminators_parameters.go | 59 +- .../terminator/list_terminators_responses.go | 7 +- .../terminator/patch_terminator_parameters.go | 52 +- .../terminator/patch_terminator_responses.go | 13 +- .../terminator/terminator_client.go | 87 +- .../update_terminator_parameters.go | 52 +- .../terminator/update_terminator_responses.go | 13 +- .../ziti_edge_management_client.go | 91 +- .../configure_ziti_edge_management.go | 239 +- rest_management_api_server/doc.go | 46 + .../embedded_spec.go | 34531 +++++++++------- .../api_session/delete_api_sessions.go | 10 +- .../delete_api_sessions_parameters.go | 5 +- .../delete_api_sessions_responses.go | 0 .../delete_api_sessions_urlbuilder.go | 2 +- .../api_session/detail_api_sessions.go | 10 +- .../detail_api_sessions_parameters.go | 5 +- .../detail_api_sessions_responses.go | 0 .../detail_api_sessions_urlbuilder.go | 2 +- .../api_session/list_api_sessions.go | 10 +- .../list_api_sessions_parameters.go | 8 +- .../list_api_sessions_responses.go | 0 .../list_api_sessions_urlbuilder.go | 2 +- .../operations/authentication/authenticate.go | 83 + .../authentication/authenticate_mfa.go | 42 +- .../authenticate_mfa_parameters.go | 109 + .../authenticate_mfa_responses.go | 126 + .../authenticate_mfa_urlbuilder.go | 111 + .../authentication/authenticate_parameters.go | 149 + .../authentication/authenticate_responses.go | 170 + .../authentication/authenticate_urlbuilder.go | 124 + .../authenticator/create_authenticator.go | 10 +- .../create_authenticator_parameters.go | 10 +- .../create_authenticator_responses.go | 0 .../create_authenticator_urlbuilder.go | 2 +- .../authenticator/delete_authenticator.go | 10 +- .../delete_authenticator_parameters.go | 5 +- .../delete_authenticator_responses.go | 0 .../delete_authenticator_urlbuilder.go | 2 +- .../authenticator/detail_authenticator.go | 10 +- .../detail_authenticator_parameters.go | 5 +- .../detail_authenticator_responses.go | 0 .../detail_authenticator_urlbuilder.go | 2 +- .../authenticator/list_authenticators.go | 10 +- .../list_authenticators_parameters.go | 3 +- .../list_authenticators_responses.go | 0 .../list_authenticators_urlbuilder.go | 2 +- .../authenticator/patch_authenticator.go | 10 +- .../patch_authenticator_parameters.go | 13 +- .../patch_authenticator_responses.go | 0 .../patch_authenticator_urlbuilder.go | 2 +- .../authenticator/update_authenticator.go | 10 +- .../update_authenticator_parameters.go | 13 +- .../update_authenticator_responses.go | 0 .../update_authenticator_urlbuilder.go | 2 +- .../certificate_authority/create_ca.go | 10 +- .../create_ca_parameters.go | 10 +- .../create_ca_responses.go | 0 .../create_ca_urlbuilder.go | 2 +- .../certificate_authority/delete_ca.go | 10 +- .../delete_ca_parameters.go | 5 +- .../delete_ca_responses.go | 0 .../delete_ca_urlbuilder.go | 2 +- .../certificate_authority/detail_ca.go | 10 +- .../detail_ca_parameters.go | 5 +- .../detail_ca_responses.go | 0 .../detail_ca_urlbuilder.go | 2 +- .../certificate_authority/get_ca_jwt.go | 10 +- .../get_ca_jwt_parameters.go | 5 +- .../get_ca_jwt_responses.go | 0 .../get_ca_jwt_urlbuilder.go | 2 +- .../certificate_authority/list_cas.go | 10 +- .../list_cas_parameters.go | 8 +- .../list_cas_responses.go | 0 .../list_cas_urlbuilder.go | 2 +- .../certificate_authority/patch_ca.go | 10 +- .../patch_ca_parameters.go | 13 +- .../patch_ca_responses.go | 0 .../patch_ca_urlbuilder.go | 2 +- .../certificate_authority/update_ca.go | 10 +- .../update_ca_parameters.go | 13 +- .../update_ca_responses.go | 0 .../update_ca_urlbuilder.go | 2 +- .../certificate_authority/verify_ca.go | 10 +- .../verify_ca_parameters.go | 6 +- .../verify_ca_responses.go | 0 .../verify_ca_urlbuilder.go | 2 +- .../operations/config/create_config.go | 10 +- .../config/create_config_parameters.go | 10 +- .../config/create_config_responses.go | 0 .../operations/config/create_config_type.go | 10 +- .../config/create_config_type_parameters.go | 10 +- .../config/create_config_type_responses.go | 0 .../config/create_config_type_urlbuilder.go | 2 +- .../config/create_config_urlbuilder.go | 2 +- .../operations/config/delete_config.go | 10 +- .../config/delete_config_parameters.go | 5 +- .../config/delete_config_responses.go | 0 .../operations/config/delete_config_type.go | 10 +- .../config/delete_config_type_parameters.go | 5 +- .../config/delete_config_type_responses.go | 0 .../config/delete_config_type_urlbuilder.go | 2 +- .../config/delete_config_urlbuilder.go | 2 +- .../operations/config/detail_config.go | 10 +- .../config/detail_config_parameters.go | 5 +- .../config/detail_config_responses.go | 0 .../operations/config/detail_config_type.go | 10 +- .../config/detail_config_type_parameters.go | 5 +- .../config/detail_config_type_responses.go | 0 .../config/detail_config_type_urlbuilder.go | 2 +- .../config/detail_config_urlbuilder.go | 2 +- .../operations/config/list_config_types.go | 10 +- .../config/list_config_types_parameters.go | 8 +- .../config/list_config_types_responses.go | 0 .../config/list_config_types_urlbuilder.go | 2 +- .../operations/config/list_configs.go | 10 +- .../config/list_configs_for_config_type.go | 10 +- ...list_configs_for_config_type_parameters.go | 5 +- .../list_configs_for_config_type_responses.go | 0 ...list_configs_for_config_type_urlbuilder.go | 2 +- .../config/list_configs_parameters.go | 8 +- .../config/list_configs_responses.go | 0 .../config/list_configs_urlbuilder.go | 2 +- .../operations/config/patch_config.go | 10 +- .../config/patch_config_parameters.go | 13 +- .../config/patch_config_responses.go | 0 .../operations/config/patch_config_type.go | 10 +- .../config/patch_config_type_parameters.go | 13 +- .../config/patch_config_type_responses.go | 0 .../config/patch_config_type_urlbuilder.go | 2 +- .../config/patch_config_urlbuilder.go | 2 +- .../operations/config/update_config.go | 10 +- .../config/update_config_parameters.go | 13 +- .../config/update_config_responses.go | 0 .../operations/config/update_config_type.go | 10 +- .../config/update_config_type_parameters.go | 13 +- .../config/update_config_type_responses.go | 0 .../config/update_config_type_urlbuilder.go | 2 +- .../config/update_config_urlbuilder.go | 2 +- .../delete_current_api_session.go | 95 + .../delete_current_api_session_parameters.go | 70 + .../delete_current_api_session_responses.go | 126 + .../delete_current_api_session_urlbuilder.go | 111 + .../detail_current_identity_authenticator.go | 95 + ...rrent_identity_authenticator_parameters.go | 95 + ...urrent_identity_authenticator_responses.go | 170 + ...rrent_identity_authenticator_urlbuilder.go | 123 + .../get_current_api_session.go | 95 + .../get_current_api_session_parameters.go | 70 + .../get_current_api_session_responses.go | 126 + .../get_current_api_session_urlbuilder.go | 111 + .../list_current_identity_authenticators.go | 95 + ...rent_identity_authenticators_parameters.go | 166 + ...rrent_identity_authenticators_responses.go | 126 + ...rent_identity_authenticators_urlbuilder.go | 147 + .../patch_current_identity_authenticator.go | 97 + ...rrent_identity_authenticator_parameters.go | 134 + ...urrent_identity_authenticator_responses.go | 214 + ...rrent_identity_authenticator_urlbuilder.go | 123 + .../update_current_identity_authenticator.go | 97 + ...rrent_identity_authenticator_parameters.go | 134 + ...urrent_identity_authenticator_responses.go | 214 + ...rrent_identity_authenticator_urlbuilder.go | 123 + .../create_mfa_recovery_codes.go | 96 + .../create_mfa_recovery_codes_parameters.go | 109 + .../create_mfa_recovery_codes_responses.go | 170 + .../create_mfa_recovery_codes_urlbuilder.go | 111 + .../operations/current_identity/delete_mfa.go | 96 + .../current_identity/delete_mfa_parameters.go | 127 + .../current_identity/delete_mfa_responses.go | 170 + .../current_identity/delete_mfa_urlbuilder.go | 111 + .../operations/current_identity/detail_mfa.go | 96 + .../current_identity/detail_mfa_parameters.go | 70 + .../current_identity/detail_mfa_qr_code.go | 96 + .../detail_mfa_qr_code_parameters.go | 70 + .../detail_mfa_qr_code_responses.go | 84 + .../detail_mfa_qr_code_urlbuilder.go | 111 + .../detail_mfa_recovery_codes.go | 96 + .../detail_mfa_recovery_codes_parameters.go | 127 + .../detail_mfa_recovery_codes_responses.go | 170 + .../detail_mfa_recovery_codes_urlbuilder.go | 111 + .../current_identity/detail_mfa_responses.go | 170 + .../current_identity/detail_mfa_urlbuilder.go | 111 + .../operations/current_identity/enroll_mfa.go | 96 + .../current_identity/enroll_mfa_parameters.go | 70 + .../current_identity/enroll_mfa_responses.go | 170 + .../current_identity/enroll_mfa_urlbuilder.go | 111 + .../current_identity/get_current_identity.go | 95 + .../get_current_identity_parameters.go | 70 + .../get_current_identity_responses.go | 126 + .../get_current_identity_urlbuilder.go | 111 + .../operations/current_identity/verify_mfa.go | 96 + .../current_identity/verify_mfa_parameters.go | 109 + .../current_identity/verify_mfa_responses.go | 170 + .../current_identity/verify_mfa_urlbuilder.go | 111 + .../database/check_data_integrity.go | 10 +- .../check_data_integrity_parameters.go | 3 +- .../check_data_integrity_responses.go | 0 .../check_data_integrity_urlbuilder.go | 2 +- .../database/create_database_snapshot.go | 10 +- .../create_database_snapshot_parameters.go | 3 +- .../create_database_snapshot_responses.go | 0 .../create_database_snapshot_urlbuilder.go | 2 +- .../database/data_integrity_results.go | 10 +- .../data_integrity_results_parameters.go | 3 +- .../data_integrity_results_responses.go | 0 .../data_integrity_results_urlbuilder.go | 2 +- .../operations/database/fix_data_integrity.go | 10 +- .../database/fix_data_integrity_parameters.go | 3 +- .../database/fix_data_integrity_responses.go | 0 .../database/fix_data_integrity_urlbuilder.go | 2 +- .../edge_router/create_edge_router.go | 10 +- .../create_edge_router_parameters.go | 10 +- .../create_edge_router_responses.go | 0 .../create_edge_router_urlbuilder.go | 2 +- .../edge_router/delete_edge_router.go | 10 +- .../delete_edge_router_parameters.go | 5 +- .../delete_edge_router_responses.go | 0 .../delete_edge_router_urlbuilder.go | 2 +- .../edge_router/detail_edge_router.go | 10 +- .../detail_edge_router_parameters.go | 5 +- .../detail_edge_router_responses.go | 0 .../detail_edge_router_urlbuilder.go | 2 +- .../list_edge_router_edge_router_policies.go | 10 +- ..._router_edge_router_policies_parameters.go | 5 +- ...e_router_edge_router_policies_responses.go | 0 ..._router_edge_router_policies_urlbuilder.go | 2 +- .../list_edge_router_identities.go | 10 +- .../list_edge_router_identities_parameters.go | 5 +- .../list_edge_router_identities_responses.go | 0 .../list_edge_router_identities_urlbuilder.go | 2 +- ...dge_router_service_edge_router_policies.go | 10 +- ...service_edge_router_policies_parameters.go | 5 +- ..._service_edge_router_policies_responses.go | 0 ...service_edge_router_policies_urlbuilder.go | 2 +- .../edge_router/list_edge_router_services.go | 10 +- .../list_edge_router_services_parameters.go | 5 +- .../list_edge_router_services_responses.go | 0 .../list_edge_router_services_urlbuilder.go | 2 +- .../edge_router/list_edge_routers.go | 10 +- .../list_edge_routers_parameters.go | 12 +- .../list_edge_routers_responses.go | 0 .../list_edge_routers_urlbuilder.go | 2 +- .../edge_router/patch_edge_router.go | 10 +- .../patch_edge_router_parameters.go | 13 +- .../patch_edge_router_responses.go | 0 .../patch_edge_router_urlbuilder.go | 2 +- .../edge_router/update_edge_router.go | 10 +- .../update_edge_router_parameters.go | 13 +- .../update_edge_router_responses.go | 0 .../update_edge_router_urlbuilder.go | 2 +- .../create_edge_router_policy.go | 10 +- .../create_edge_router_policy_parameters.go | 10 +- .../create_edge_router_policy_responses.go | 0 .../create_edge_router_policy_urlbuilder.go | 2 +- .../delete_edge_router_policy.go | 10 +- .../delete_edge_router_policy_parameters.go | 5 +- .../delete_edge_router_policy_responses.go | 0 .../delete_edge_router_policy_urlbuilder.go | 2 +- .../detail_edge_router_policy.go | 10 +- .../detail_edge_router_policy_parameters.go | 5 +- .../detail_edge_router_policy_responses.go | 0 .../detail_edge_router_policy_urlbuilder.go | 2 +- .../list_edge_router_policies.go | 10 +- .../list_edge_router_policies_parameters.go | 8 +- .../list_edge_router_policies_responses.go | 0 .../list_edge_router_policies_urlbuilder.go | 2 +- .../list_edge_router_policy_edge_routers.go | 10 +- ...e_router_policy_edge_routers_parameters.go | 5 +- ...ge_router_policy_edge_routers_responses.go | 0 ...e_router_policy_edge_routers_urlbuilder.go | 2 +- .../list_edge_router_policy_identities.go | 10 +- ...dge_router_policy_identities_parameters.go | 5 +- ...edge_router_policy_identities_responses.go | 0 ...dge_router_policy_identities_urlbuilder.go | 2 +- .../patch_edge_router_policy.go | 10 +- .../patch_edge_router_policy_parameters.go | 11 +- .../patch_edge_router_policy_responses.go | 0 .../patch_edge_router_policy_urlbuilder.go | 2 +- .../update_edge_router_policy.go | 10 +- .../update_edge_router_policy_parameters.go | 11 +- .../update_edge_router_policy_responses.go | 0 .../update_edge_router_policy_urlbuilder.go | 2 +- .../enrollment/delete_enrollment.go | 10 +- .../delete_enrollment_parameters.go | 5 +- .../enrollment/delete_enrollment_responses.go | 0 .../delete_enrollment_urlbuilder.go | 2 +- .../enrollment/detail_enrollment.go | 10 +- .../detail_enrollment_parameters.go | 5 +- .../enrollment/detail_enrollment_responses.go | 0 .../detail_enrollment_urlbuilder.go | 2 +- .../operations/enrollment/list_enrollments.go | 10 +- .../enrollment/list_enrollments_parameters.go | 8 +- .../enrollment/list_enrollments_responses.go | 0 .../enrollment/list_enrollments_urlbuilder.go | 2 +- .../associate_identitys_service_configs.go | 10 +- ...te_identitys_service_configs_parameters.go | 11 +- ...ate_identitys_service_configs_responses.go | 0 ...te_identitys_service_configs_urlbuilder.go | 2 +- .../operations/identity/create_identity.go | 10 +- .../identity/create_identity_parameters.go | 10 +- .../identity/create_identity_responses.go | 0 .../identity/create_identity_urlbuilder.go | 2 +- .../operations/identity/delete_identity.go | 10 +- .../identity/delete_identity_parameters.go | 5 +- .../identity/delete_identity_responses.go | 0 .../identity/delete_identity_urlbuilder.go | 2 +- .../operations/identity/detail_identity.go | 10 +- .../identity/detail_identity_parameters.go | 5 +- .../identity/detail_identity_responses.go | 0 .../identity/detail_identity_type.go | 10 +- .../detail_identity_type_parameters.go | 5 +- .../detail_identity_type_responses.go | 0 .../detail_identity_type_urlbuilder.go | 2 +- .../identity/detail_identity_urlbuilder.go | 2 +- .../disassociate_identitys_service_configs.go | 10 +- ...te_identitys_service_configs_parameters.go | 11 +- ...ate_identitys_service_configs_responses.go | 0 ...te_identitys_service_configs_urlbuilder.go | 2 +- .../get_identity_failed_service_requests.go | 10 +- ...tity_failed_service_requests_parameters.go | 5 +- ...ntity_failed_service_requests_responses.go | 6 +- ...tity_failed_service_requests_urlbuilder.go | 2 +- .../identity/get_identity_policy_advice.go | 10 +- .../get_identity_policy_advice_parameters.go | 6 +- .../get_identity_policy_advice_responses.go | 0 .../get_identity_policy_advice_urlbuilder.go | 2 +- .../identity/get_identity_posture_data.go | 10 +- .../get_identity_posture_data_parameters.go | 5 +- .../get_identity_posture_data_responses.go | 6 +- .../get_identity_posture_data_urlbuilder.go | 2 +- .../operations/identity/list_identities.go | 10 +- .../identity/list_identities_parameters.go | 12 +- .../identity/list_identities_responses.go | 0 .../identity/list_identities_urlbuilder.go | 2 +- .../identity/list_identity_edge_routers.go | 10 +- .../list_identity_edge_routers_parameters.go | 5 +- .../list_identity_edge_routers_responses.go | 0 .../list_identity_edge_routers_urlbuilder.go | 2 +- .../list_identity_service_policies.go | 10 +- ...st_identity_service_policies_parameters.go | 5 +- ...ist_identity_service_policies_responses.go | 0 ...st_identity_service_policies_urlbuilder.go | 2 +- .../identity/list_identity_services.go | 10 +- .../list_identity_services_parameters.go | 5 +- .../list_identity_services_responses.go | 0 .../list_identity_services_urlbuilder.go | 2 +- .../identity/list_identity_types.go | 10 +- .../list_identity_types_parameters.go | 8 +- .../identity/list_identity_types_responses.go | 0 .../list_identity_types_urlbuilder.go | 2 +- .../list_identitys_edge_router_policies.go | 12 +- ...entitys_edge_router_policies_parameters.go | 5 +- ...dentitys_edge_router_policies_responses.go | 0 ...entitys_edge_router_policies_urlbuilder.go | 2 +- .../list_identitys_service_configs.go | 10 +- ...st_identitys_service_configs_parameters.go | 5 +- ...ist_identitys_service_configs_responses.go | 0 ...st_identitys_service_configs_urlbuilder.go | 2 +- .../operations/identity/patch_identity.go | 10 +- .../identity/patch_identity_parameters.go | 11 +- .../identity/patch_identity_responses.go | 0 .../identity/patch_identity_urlbuilder.go | 2 +- .../identity/remove_identity_mfa.go | 10 +- .../remove_identity_mfa_parameters.go | 5 +- .../identity/remove_identity_mfa_responses.go | 0 .../remove_identity_mfa_urlbuilder.go | 2 +- .../operations/identity/update_identity.go | 10 +- .../identity/update_identity_parameters.go | 11 +- .../identity/update_identity_responses.go | 0 .../identity/update_identity_urlbuilder.go | 2 +- .../operations/informational/detail_spec.go | 82 + .../informational/detail_spec_body.go | 82 + .../detail_spec_body_parameters.go | 95 + .../detail_spec_body_responses.go | 82 + .../detail_spec_body_urlbuilder.go | 123 + .../informational/detail_spec_parameters.go | 95 + .../informational/detail_spec_responses.go | 82 + .../informational/detail_spec_urlbuilder.go | 123 + .../operations/informational/list_root.go | 80 + .../informational/list_root_parameters.go | 70 + .../informational/list_root_responses.go | 82 + .../informational/list_root_urlbuilder.go | 111 + .../operations/informational/list_specs.go | 82 + .../informational/list_specs_parameters.go | 70 + .../informational/list_specs_responses.go | 82 + .../informational/list_specs_urlbuilder.go | 111 + .../operations/informational/list_summary.go | 10 +- .../informational/list_summary_parameters.go | 3 +- .../informational/list_summary_responses.go | 0 .../informational/list_summary_urlbuilder.go | 2 +- .../operations/informational/list_version.go | 80 + .../informational/list_version_parameters.go | 70 + .../informational/list_version_responses.go | 82 + .../informational/list_version_urlbuilder.go | 111 + .../posture_checks/create_posture_check.go | 10 +- .../create_posture_check_parameters.go | 10 +- .../create_posture_check_responses.go | 0 .../create_posture_check_urlbuilder.go | 2 +- .../posture_checks/delete_posture_check.go | 10 +- .../delete_posture_check_parameters.go | 5 +- .../delete_posture_check_responses.go | 0 .../delete_posture_check_urlbuilder.go | 2 +- .../posture_checks/detail_posture_check.go | 10 +- .../detail_posture_check_parameters.go | 5 +- .../detail_posture_check_responses.go | 0 .../detail_posture_check_type.go | 10 +- .../detail_posture_check_type_parameters.go | 5 +- .../detail_posture_check_type_responses.go | 0 .../detail_posture_check_type_urlbuilder.go | 2 +- .../detail_posture_check_urlbuilder.go | 2 +- .../list_posture_check_types.go | 10 +- .../list_posture_check_types_parameters.go | 8 +- .../list_posture_check_types_responses.go | 0 .../list_posture_check_types_urlbuilder.go | 2 +- .../posture_checks/list_posture_checks.go | 10 +- .../list_posture_checks_parameters.go | 12 +- .../list_posture_checks_responses.go | 0 .../list_posture_checks_urlbuilder.go | 2 +- .../posture_checks/patch_posture_check.go | 10 +- .../patch_posture_check_parameters.go | 11 +- .../patch_posture_check_responses.go | 0 .../patch_posture_check_urlbuilder.go | 2 +- .../posture_checks/update_posture_check.go | 10 +- .../update_posture_check_parameters.go | 11 +- .../update_posture_check_responses.go | 0 .../update_posture_check_urlbuilder.go | 2 +- .../list_edge_router_role_attributes.go | 10 +- ..._edge_router_role_attributes_parameters.go | 8 +- ...t_edge_router_role_attributes_responses.go | 0 ..._edge_router_role_attributes_urlbuilder.go | 2 +- .../list_identity_role_attributes.go | 10 +- ...ist_identity_role_attributes_parameters.go | 8 +- ...list_identity_role_attributes_responses.go | 0 ...ist_identity_role_attributes_urlbuilder.go | 2 +- .../list_service_role_attributes.go | 10 +- ...list_service_role_attributes_parameters.go | 8 +- .../list_service_role_attributes_responses.go | 0 ...list_service_role_attributes_urlbuilder.go | 2 +- .../operations/router/create_router.go | 95 + .../router/create_router_parameters.go | 109 + .../router/create_router_responses.go | 170 + .../router/create_router_urlbuilder.go | 111 + .../router}/create_transit_router.go | 16 +- .../create_transit_router_parameters.go | 18 +- .../create_transit_router_responses.go | 2 +- .../create_transit_router_urlbuilder.go | 4 +- .../operations/router/delete_router.go | 95 + .../router/delete_router_parameters.go | 95 + .../router/delete_router_responses.go | 214 + .../router/delete_router_urlbuilder.go | 123 + .../router}/delete_transit_router.go | 16 +- .../delete_transit_router_parameters.go | 7 +- .../delete_transit_router_responses.go | 2 +- .../delete_transit_router_urlbuilder.go | 4 +- .../operations/router/detail_router.go | 95 + .../router/detail_router_parameters.go | 95 + .../router/detail_router_responses.go | 170 + .../router/detail_router_urlbuilder.go | 123 + .../router}/detail_transit_router.go | 16 +- .../detail_transit_router_parameters.go | 7 +- .../detail_transit_router_responses.go | 10 +- .../detail_transit_router_urlbuilder.go | 4 +- .../operations/router/list_routers.go | 96 + .../router/list_routers_parameters.go | 32 +- .../router/list_routers_responses.go | 56 +- .../router/list_routers_urlbuilder.go | 28 +- .../router}/list_transit_routers.go | 16 +- .../list_transit_routers_parameters.go | 10 +- .../router}/list_transit_routers_responses.go | 8 +- .../list_transit_routers_urlbuilder.go | 4 +- .../operations/router/patch_router.go | 95 + .../router/patch_router_parameters.go | 134 + .../router/patch_router_responses.go | 214 + .../router/patch_router_urlbuilder.go | 123 + .../router}/patch_transit_router.go | 16 +- .../patch_transit_router_parameters.go | 19 +- .../router}/patch_transit_router_responses.go | 2 +- .../patch_transit_router_urlbuilder.go | 4 +- .../operations/router/update_router.go | 95 + .../router/update_router_parameters.go | 134 + .../router/update_router_responses.go | 214 + .../router/update_router_urlbuilder.go | 123 + .../router}/update_transit_router.go | 16 +- .../update_transit_router_parameters.go | 19 +- .../update_transit_router_responses.go | 2 +- .../update_transit_router_urlbuilder.go | 4 +- .../operations/service/create_service.go | 10 +- .../service/create_service_parameters.go | 10 +- .../service/create_service_responses.go | 0 .../service/create_service_urlbuilder.go | 2 +- .../operations/service/delete_service.go | 95 + .../service/delete_service_parameters.go | 95 + .../service/delete_service_responses.go | 214 + .../service/delete_service_urlbuilder.go | 123 + .../operations/service/detail_service.go | 95 + .../service/detail_service_parameters.go | 95 + .../service/detail_service_responses.go | 170 + .../service/detail_service_urlbuilder.go | 123 + .../operations/service/list_service_config.go | 10 +- .../service/list_service_config_parameters.go | 9 +- .../service/list_service_config_responses.go | 0 .../service/list_service_config_urlbuilder.go | 2 +- .../service/list_service_edge_routers.go | 10 +- .../list_service_edge_routers_parameters.go | 9 +- .../list_service_edge_routers_responses.go | 0 .../list_service_edge_routers_urlbuilder.go | 2 +- .../service/list_service_identities.go | 10 +- .../list_service_identities_parameters.go | 9 +- .../list_service_identities_responses.go | 0 .../list_service_identities_urlbuilder.go | 2 +- ...st_service_service_edge_router_policies.go | 10 +- ...service_edge_router_policies_parameters.go | 9 +- ..._service_edge_router_policies_responses.go | 0 ...service_edge_router_policies_urlbuilder.go | 2 +- .../service/list_service_service_policies.go | 10 +- ...ist_service_service_policies_parameters.go | 9 +- ...list_service_service_policies_responses.go | 0 ...ist_service_service_policies_urlbuilder.go | 2 +- .../service/list_service_terminators.go | 96 + .../list_service_terminators_parameters.go | 190 + .../list_service_terminators_responses.go | 0 .../list_service_terminators_urlbuilder.go | 157 + .../operations/service/list_services.go | 96 + .../service/list_services_parameters.go | 225 + .../service/list_services_responses.go | 126 + .../service/list_services_urlbuilder.go | 171 + .../operations/service/patch_service.go | 95 + .../service/patch_service_parameters.go | 134 + .../service/patch_service_responses.go | 214 + .../service/patch_service_urlbuilder.go | 123 + .../operations/service/update_service.go | 95 + .../service/update_service_parameters.go | 134 + .../service/update_service_responses.go | 214 + .../service/update_service_urlbuilder.go | 123 + .../create_service_edge_router_policy.go | 10 +- ...e_service_edge_router_policy_parameters.go | 10 +- ...te_service_edge_router_policy_responses.go | 0 ...e_service_edge_router_policy_urlbuilder.go | 2 +- .../delete_service_edge_router_policy.go | 10 +- ...e_service_edge_router_policy_parameters.go | 5 +- ...te_service_edge_router_policy_responses.go | 0 ...e_service_edge_router_policy_urlbuilder.go | 2 +- .../detail_service_edge_router_policy.go | 10 +- ...l_service_edge_router_policy_parameters.go | 5 +- ...il_service_edge_router_policy_responses.go | 0 ...l_service_edge_router_policy_urlbuilder.go | 2 +- .../list_service_edge_router_policies.go | 10 +- ...service_edge_router_policies_parameters.go | 8 +- ..._service_edge_router_policies_responses.go | 0 ...service_edge_router_policies_urlbuilder.go | 2 +- ...service_edge_router_policy_edge_routers.go | 10 +- ...e_router_policy_edge_routers_parameters.go | 5 +- ...ge_router_policy_edge_routers_responses.go | 0 ...e_router_policy_edge_routers_urlbuilder.go | 2 +- ...ist_service_edge_router_policy_services.go | 10 +- ..._edge_router_policy_services_parameters.go | 5 +- ...e_edge_router_policy_services_responses.go | 0 ..._edge_router_policy_services_urlbuilder.go | 2 +- .../patch_service_edge_router_policy.go | 10 +- ...h_service_edge_router_policy_parameters.go | 11 +- ...ch_service_edge_router_policy_responses.go | 0 ...h_service_edge_router_policy_urlbuilder.go | 2 +- .../update_service_edge_router_policy.go | 10 +- ...e_service_edge_router_policy_parameters.go | 11 +- ...te_service_edge_router_policy_responses.go | 0 ...e_service_edge_router_policy_urlbuilder.go | 2 +- .../service_policy/create_service_policy.go | 10 +- .../create_service_policy_parameters.go | 10 +- .../create_service_policy_responses.go | 0 .../create_service_policy_urlbuilder.go | 2 +- .../service_policy/delete_service_policy.go | 10 +- .../delete_service_policy_parameters.go | 5 +- .../delete_service_policy_responses.go | 0 .../delete_service_policy_urlbuilder.go | 2 +- .../service_policy/detail_service_policy.go | 10 +- .../detail_service_policy_parameters.go | 5 +- .../detail_service_policy_responses.go | 0 .../detail_service_policy_urlbuilder.go | 2 +- .../service_policy/list_service_policies.go | 10 +- .../list_service_policies_parameters.go | 8 +- .../list_service_policies_responses.go | 0 .../list_service_policies_urlbuilder.go | 2 +- .../list_service_policy_identities.go | 10 +- ...st_service_policy_identities_parameters.go | 9 +- ...ist_service_policy_identities_responses.go | 0 ...st_service_policy_identities_urlbuilder.go | 2 +- .../list_service_policy_posture_checks.go | 10 +- ...ervice_policy_posture_checks_parameters.go | 9 +- ...service_policy_posture_checks_responses.go | 0 ...ervice_policy_posture_checks_urlbuilder.go | 2 +- .../list_service_policy_services.go | 10 +- ...list_service_policy_services_parameters.go | 9 +- .../list_service_policy_services_responses.go | 0 ...list_service_policy_services_urlbuilder.go | 2 +- .../service_policy/patch_service_policy.go | 10 +- .../patch_service_policy_parameters.go | 11 +- .../patch_service_policy_responses.go | 0 .../patch_service_policy_urlbuilder.go | 2 +- .../service_policy/update_service_policy.go | 10 +- .../update_service_policy_parameters.go | 11 +- .../update_service_policy_responses.go | 0 .../update_service_policy_urlbuilder.go | 2 +- .../operations/session/delete_session.go | 10 +- .../session/delete_session_parameters.go | 95 + .../session/delete_session_responses.go | 214 + .../session/delete_session_urlbuilder.go | 123 + .../operations/session/detail_session.go | 10 +- .../session/detail_session_parameters.go | 95 + .../session/detail_session_responses.go | 170 + .../session/detail_session_route_path.go | 10 +- .../detail_session_route_path_parameters.go | 5 +- .../detail_session_route_path_responses.go | 0 .../detail_session_route_path_urlbuilder.go | 2 +- .../session/detail_session_urlbuilder.go | 123 + .../operations/session/list_sessions.go | 10 +- .../session/list_sessions_parameters.go | 166 + .../session/list_sessions_responses.go | 126 + .../session/list_sessions_urlbuilder.go | 147 + .../terminator/create_terminator.go | 10 +- .../create_terminator_parameters.go | 10 +- .../terminator/create_terminator_responses.go | 0 .../create_terminator_urlbuilder.go | 2 +- .../terminator/delete_terminator.go | 10 +- .../delete_terminator_parameters.go | 5 +- .../terminator/delete_terminator_responses.go | 0 .../delete_terminator_urlbuilder.go | 2 +- .../terminator/detail_terminator.go | 10 +- .../detail_terminator_parameters.go | 5 +- .../terminator/detail_terminator_responses.go | 0 .../detail_terminator_urlbuilder.go | 2 +- .../operations/terminator/list_terminators.go | 10 +- .../terminator/list_terminators_parameters.go | 8 +- .../terminator/list_terminators_responses.go | 0 .../terminator/list_terminators_urlbuilder.go | 2 +- .../operations/terminator/patch_terminator.go | 10 +- .../terminator/patch_terminator_parameters.go | 11 +- .../terminator/patch_terminator_responses.go | 0 .../terminator/patch_terminator_urlbuilder.go | 2 +- .../terminator/update_terminator.go | 10 +- .../update_terminator_parameters.go | 11 +- .../terminator/update_terminator_responses.go | 0 .../update_terminator_urlbuilder.go | 2 +- .../operations/ziti_edge_management_api.go | 545 +- rest_management_api_server/server.go | 535 + rest_model/api_error.go | 50 +- rest_model/api_error_args.go | 7 + rest_model/api_error_cause.go | 21 + rest_model/api_error_envelope.go | 48 + rest_model/api_field_error.go | 7 + rest_model/api_session_detail.go | 51 + rest_model/api_session_list.go | 24 + rest_model/api_session_posture_data.go | 30 + rest_model/api_version.go | 7 + rest_model/attributes.go | 7 + rest_model/auth_query_detail.go | 64 +- rest_model/auth_query_list.go | 24 + rest_model/authenticate.go | 101 +- rest_model/authenticator_create.go | 39 +- rest_model/authenticator_detail.go | 35 + rest_model/authenticator_list.go | 24 + rest_model/authenticator_patch.go | 81 +- .../authenticator_patch_with_current.go | 60 +- rest_model/authenticator_update.go | 112 +- .../authenticator_update_with_current.go | 60 +- rest_model/base_entity.go | 72 +- rest_model/ca_create.go | 54 +- rest_model/ca_detail.go | 37 + rest_model/ca_list.go | 24 + rest_model/ca_patch.go | 54 +- rest_model/ca_update.go | 53 +- rest_model/common_edge_router_properties.go | 43 +- rest_model/config_create.go | 39 +- rest_model/config_detail.go | 39 +- rest_model/config_list.go | 24 + rest_model/config_patch.go | 35 +- rest_model/config_type_create.go | 34 +- rest_model/config_type_detail.go | 22 + rest_model/config_type_list.go | 24 + rest_model/config_type_patch.go | 34 +- rest_model/config_type_update.go | 34 +- rest_model/config_types.go | 7 + rest_model/config_update.go | 39 +- ...urrent_api_session_certificate_envelope.go | 48 + rest_model/create_envelope.go | 50 +- rest_model/create_location.go | 33 +- .../current_api_session_certificate_create.go | 7 + ...api_session_certificate_create_response.go | 17 + .../current_api_session_certificate_detail.go | 17 + .../current_api_session_certificate_list.go | 24 + rest_model/current_api_session_detail.go | 17 + .../current_api_session_detail_envelope.go | 54 +- ...current_api_session_service_update_list.go | 9 +- .../current_identity_detail_envelope.go | 48 + .../current_identity_edge_router_detail.go | 21 + .../current_identity_edge_router_list.go | 24 + rest_model/data_integrity_check_detail.go | 7 + .../data_integrity_check_detail_list.go | 24 + rest_model/data_integrity_check_details.go | 28 + .../data_integrity_check_result_envelope.go | 48 + rest_model/detail_api_session_envelope.go | 54 +- rest_model/detail_authenticator_envelope.go | 48 + rest_model/detail_ca_envelope.go | 48 + rest_model/detail_config_envelope.go | 48 + rest_model/detail_config_type_envelope.go | 48 + ...urrent_api_session_certificate_envelope.go | 48 + .../detail_edge_router_policy_envelope.go | 48 + rest_model/detail_enrollment_envelope.go | 48 + rest_model/detail_geo_region_envelope.go | 123 - rest_model/detail_identity_envelope.go | 48 + rest_model/detail_identity_type_envelope.go | 48 + rest_model/detail_mfa.go | 17 + rest_model/detail_mfa_envelope.go | 48 + rest_model/detail_mfa_recovery_codes.go | 17 + .../detail_mfa_recovery_codes_envelope.go | 48 + rest_model/detail_posture_check_envelope.go | 45 + .../detail_posture_check_type_envelope.go | 48 + ..._envelope.go => detail_router_envelope.go} | 70 +- .../detail_service_edge_policy_envelope.go | 48 + rest_model/detail_service_envelope.go | 48 + rest_model/detail_service_policy_envelop.go | 48 + rest_model/detail_session_envelope.go | 48 + .../detail_session_route_path_envelope.go | 48 + rest_model/detail_spec_body_envelope.go | 68 +- rest_model/detail_spec_envelope.go | 48 + rest_model/detail_terminator_envelope.go | 48 + rest_model/detailed_edge_router_envelope.go | 48 + rest_model/dial_bind.go | 11 + rest_model/dial_bind_array.go | 22 + rest_model/edge_router_create.go | 77 +- rest_model/edge_router_detail.go | 56 + rest_model/edge_router_list.go | 24 + rest_model/edge_router_patch.go | 77 +- rest_model/edge_router_policy_create.go | 84 +- rest_model/edge_router_policy_detail.go | 119 +- rest_model/edge_router_policy_list.go | 24 + rest_model/edge_router_policy_patch.go | 84 +- rest_model/edge_router_policy_update.go | 84 +- rest_model/edge_router_update.go | 77 +- rest_model/empty.go | 35 +- rest_model/enrollment_certs.go | 7 + rest_model/enrollment_certs_envelope.go | 50 +- rest_model/enrollment_detail.go | 76 + rest_model/enrollment_list.go | 24 + rest_model/entity_ref.go | 33 +- rest_model/env_info.go | 7 + ...n_request.go => failed_service_request.go} | 74 +- ....go => failed_service_request_envelope.go} | 66 +- rest_model/failed_service_request_list.go | 26 +- rest_model/geo_region_detail.go | 139 - .../get_identity_policy_advice_envelope.go | 48 + rest_model/identity_authenticators.go | 60 +- rest_model/identity_create.go | 247 +- rest_model/identity_detail.go | 268 +- rest_model/identity_enrollments.go | 111 +- rest_model/identity_list.go | 24 + rest_model/identity_patch.go | 210 +- rest_model/identity_type.go | 11 + rest_model/identity_type_detail.go | 17 + rest_model/identity_type_list.go | 26 +- rest_model/identity_update.go | 223 +- rest_model/link.go | 7 + rest_model/links.go | 22 + rest_model/list_api_sessions_envelope.go | 52 +- rest_model/list_authenticators_envelope.go | 48 +- rest_model/list_cas_envelope.go | 46 + ...go => list_client_terminators_envelope.go} | 68 +- rest_model/list_config_types_envelope.go | 46 + rest_model/list_configs_envelope.go | 46 + ...rrent_api_session_certificates_envelope.go | 52 +- ...nt_api_session_service_updates_envelope.go | 48 + ..._current_identity_edge_routers_envelope.go | 46 + .../list_edge_router_policies_envelope.go | 46 + rest_model/list_edge_routers_envelope.go | 46 + rest_model/list_enrollments_envelope.go | 46 + rest_model/list_identities_envelope.go | 46 + rest_model/list_identity_types_envelope.go | 46 + rest_model/list_posture_check_envelope.go | 49 + .../list_posture_check_types_envelope.go | 46 + rest_model/list_protocols.go | 22 + rest_model/list_protocols_envelope.go | 60 +- rest_model/list_role_attributes_envelope.go | 46 + ...s_envelope.go => list_routers_envelope.go} | 68 +- rest_model/list_service_configs_envelope.go | 46 + ...t_service_edge_router_policies_envelope.go | 46 + rest_model/list_service_policies_envelope.go | 46 + rest_model/list_services_envelope.go | 46 + rest_model/list_sessions_envelope.go | 46 + rest_model/list_specs_envelope.go | 46 + rest_model/list_summary_counts.go | 7 + rest_model/list_summary_counts_envelope.go | 60 +- rest_model/list_terminators_envelope.go | 46 + rest_model/list_version_envelope.go | 48 + rest_model/meta.go | 31 +- rest_model/mfa_code.go | 7 + rest_model/mfa_created_envelope.go | 123 - rest_model/mfa_formats.go | 11 + rest_model/mfa_providers.go | 11 + rest_model/named_role.go | 7 + rest_model/named_roles.go | 24 + rest_model/operating_system.go | 50 +- rest_model/os_type.go | 11 + rest_model/pagination.go | 7 + rest_model/password.go | 7 + rest_model/password_nullable.go | 9 +- rest_model/policy_advice.go | 72 +- rest_model/policy_failure.go | 32 +- rest_model/posture_check_create.go | 72 +- rest_model/posture_check_detail.go | 94 +- rest_model/posture_check_domain_create.go | 67 +- rest_model/posture_check_domain_detail.go | 81 +- rest_model/posture_check_domain_patch.go | 55 +- rest_model/posture_check_domain_update.go | 67 +- rest_model/posture_check_failure.go | 7 + rest_model/posture_check_failure_domain.go | 11 + .../posture_check_failure_mac_address.go | 11 + rest_model/posture_check_failure_mfa.go | 11 + .../posture_check_failure_operating_system.go | 51 + ...e_check_failure_operating_system_actual.go | 7 + rest_model/posture_check_failure_process.go | 47 + .../posture_check_failure_process_actual.go | 29 +- .../posture_check_failure_process_multi.go | 97 +- .../posture_check_mac_address_create.go | 67 +- .../posture_check_mac_address_detail.go | 81 +- rest_model/posture_check_mac_address_patch.go | 55 +- .../posture_check_mac_address_update.go | 67 +- rest_model/posture_check_mfa_create.go | 61 +- rest_model/posture_check_mfa_detail.go | 81 +- rest_model/posture_check_mfa_patch.go | 49 +- rest_model/posture_check_mfa_update.go | 61 +- .../posture_check_operating_system_create.go | 89 +- .../posture_check_operating_system_detail.go | 103 +- .../posture_check_operating_system_patch.go | 77 +- .../posture_check_operating_system_update.go | 89 +- rest_model/posture_check_patch.go | 54 +- rest_model/posture_check_process_create.go | 85 +- rest_model/posture_check_process_detail.go | 99 +- .../posture_check_process_multi_create.go | 127 +- .../posture_check_process_multi_detail.go | 141 +- .../posture_check_process_multi_patch.go | 93 +- .../posture_check_process_multi_update.go | 127 +- rest_model/posture_check_process_patch.go | 73 +- rest_model/posture_check_process_update.go | 85 +- rest_model/posture_check_type.go | 19 +- rest_model/posture_check_type_detail.go | 40 +- rest_model/posture_check_type_list.go | 26 +- rest_model/posture_check_update.go | 72 +- rest_model/posture_data.go | 114 + rest_model/posture_data_base.go | 7 + rest_model/posture_data_domain.go | 17 + ...a_envelope.go => posture_data_envelope.go} | 68 +- rest_model/posture_data_mac.go | 17 + rest_model/posture_data_mfa.go | 7 + rest_model/posture_data_os.go | 17 + rest_model/posture_data_process.go | 17 + rest_model/posture_queries.go | 50 +- rest_model/posture_query.go | 98 +- rest_model/posture_query_process.go | 29 +- rest_model/posture_response_create.go | 34 +- rest_model/posture_response_domain_create.go | 25 +- .../posture_response_mac_address_create.go | 25 +- ...osture_response_operating_system_create.go | 25 +- rest_model/posture_response_process_create.go | 83 +- rest_model/process.go | 50 +- rest_model/process_multi.go | 50 +- rest_model/protocol.go | 7 + rest_model/role_attributes_list.go | 7 + rest_model/roles.go | 7 + ...nsit_router_create.go => router_create.go} | 53 +- ...nsit_router_detail.go => router_detail.go} | 49 +- rest_model/router_entity_ref.go | 17 + .../router_extend_enrollment_request.go | 7 + .../{geo_region_list.go => router_list.go} | 34 +- ...ransit_router_patch.go => router_patch.go} | 51 +- ...nsit_router_update.go => router_update.go} | 53 +- rest_model/sdk_info.go | 7 + rest_model/semantic.go | 11 + rest_model/service_config_assign.go | 7 + rest_model/service_config_detail.go | 49 + rest_model/service_config_list.go | 24 + rest_model/service_configs_assign_list.go | 24 + rest_model/service_create.go | 33 +- rest_model/service_detail.go | 82 +- .../service_edge_router_policy_create.go | 84 +- .../service_edge_router_policy_detail.go | 123 +- rest_model/service_edge_router_policy_list.go | 24 + .../service_edge_router_policy_patch.go | 84 +- .../service_edge_router_policy_update.go | 84 +- rest_model/service_list.go | 24 + rest_model/service_patch.go | 33 +- rest_model/service_policy_create.go | 141 +- rest_model/service_policy_detail.go | 193 +- rest_model/service_policy_list.go | 24 + rest_model/service_policy_patch.go | 128 +- rest_model/service_policy_update.go | 141 +- rest_model/service_update.go | 33 +- rest_model/session_create.go | 60 +- rest_model/session_create_envelope.go | 50 +- rest_model/session_detail.go | 116 +- rest_model/session_edge_router.go | 22 + rest_model/session_list.go | 24 + rest_model/session_route_path_detail.go | 7 + rest_model/spec_body_detail.go | 7 + rest_model/spec_detail.go | 17 + rest_model/spec_list.go | 24 + rest_model/tags.go | 7 + ...limited.go => terminator_client_detail.go} | 63 +- ...uter_list.go => terminator_client_list.go} | 34 +- rest_model/terminator_cost.go | 7 + rest_model/terminator_cost_map.go | 28 +- rest_model/terminator_create.go | 81 +- rest_model/terminator_detail.go | 179 +- rest_model/terminator_list.go | 24 + rest_model/terminator_patch.go | 81 +- rest_model/terminator_precedence.go | 11 + rest_model/terminator_precedence_map.go | 22 + rest_model/terminator_update.go | 81 +- rest_model/username.go | 7 + rest_model/username_nullable.go | 9 +- rest_model/version.go | 40 +- rest_model/version_info.go | 7 + .../detail_geo_region_parameters.go | 96 - .../geo_region/detail_geo_region_responses.go | 170 - .../detail_geo_region_urlbuilder.go | 123 - .../operations/geo_region/list_geo_regions.go | 98 - scripts/generate_rest.ps1 | 104 +- scripts/generate_rest.sh | 77 +- specs/client.yml | 3742 ++ specs/management.yml | 13093 ++++++ specs/source/client.yml | 115 + .../current-api-session-certificates.yml | 165 + .../current-api-session-service-updates.yml | 45 + .../client/current-identity-edge-routers.yml | 49 + specs/source/client/enroll.yml | 201 + specs/source/client/posture-response.yml | 124 + specs/source/client/protocols.yml | 41 + specs/source/client/services.yml | 104 + specs/source/client/sessions.yml | 105 + specs/source/client/well-known.yml | 87 + specs/source/management.yml | 307 + specs/source/management/api-sessions.yml | 66 + specs/source/management/authenticators.yml | 126 + specs/source/management/cas.yml | 359 + specs/source/management/config-types.yml | 234 + specs/source/management/configs.yml | 251 + specs/source/management/database.yml | 123 + .../management/edge-router-policies.yml | 268 + specs/source/management/edge-routers.yml | 369 + specs/source/management/enrollments.yml | 151 + .../management/failed-service-request.yml | 190 + specs/source/management/identities.yml | 525 + specs/source/management/identity-types.yml | 91 + .../source/management/posture-check-types.yml | 92 + specs/source/management/posture-checks.yml | 590 + specs/source/management/posture-data.yml | 119 + specs/source/management/role-attributes.yml | 84 + specs/source/management/routers.yml | 345 + specs/source/management/service-configs.yml | 61 + .../service-edge-router-policies.yml | 266 + specs/source/management/service-policies.yml | 322 + specs/source/management/services.yml | 321 + specs/source/management/sessions.yml | 102 + specs/source/management/summary.yml | 38 + specs/source/management/terminators.yml | 265 + specs/source/shared/api-sessions.yml | 67 + specs/source/shared/auth-query.yml | 25 + specs/source/shared/authenticate.yml | 130 + specs/source/shared/authenticators.yml | 128 + specs/source/shared/base-entity.yml | 99 + specs/source/shared/config-types.yml | 7 + specs/source/shared/current-api-session.yml | 94 + .../current-identity-authenticators.yml | 91 + specs/source/shared/current-identity-mfa.yml | 274 + specs/source/shared/current-identity.yml | 63 + specs/source/shared/edge-routers.yml | 25 + specs/source/shared/identities.yml | 124 + specs/source/shared/parameters.yml | 55 + specs/source/shared/posture-checks.yml | 21 + specs/source/shared/posture-queries.yml | 49 + specs/source/shared/services.yml | 77 + specs/source/shared/sessions.yml | 81 + specs/source/shared/specs.yml | 105 + specs/source/shared/standard-request.yml | 18 + specs/source/shared/standard-responses.yml | 224 + specs/source/shared/terminators.yml | 21 + specs/source/shared/version.yml | 88 + specs/swagger.yml | 2 + tests/accept_manual_start_test.go | 10 +- tests/addressable_terminators_test.go | 22 +- tests/api_error_test.go | 10 +- tests/api_session_certificates_test.go | 13 +- tests/api_session_test.go | 10 +- tests/auth_cert_test.go | 24 +- tests/auth_perf_test.go | 22 +- tests/auth_updb_test.go | 20 +- tests/authenticate.go | 228 +- tests/authenticator_test.go | 187 +- tests/ca_test.go | 102 +- tests/config_test.go | 111 +- tests/config_type_test.go | 52 +- tests/context.go | 195 +- tests/current_identity_test.go | 12 +- tests/data_flow_close_test.go | 56 +- tests/data_flow_hs_rotating_test.go | 16 +- tests/data_flow_hs_test.go | 10 +- tests/data_flow_test.go | 8 +- tests/edge_router_policy_test.go | 108 +- tests/edge_router_test.go | 36 +- tests/enrollment_ca_auto_test.go | 14 +- tests/enrollment_router_test.go | 92 +- tests/enrollment_updb_test.go | 12 +- tests/entities.go | 8 +- tests/events_test.go | 14 +- tests/identity_test.go | 100 +- tests/mfa_ziti_test.go | 68 +- tests/posture_check_domain_test.go | 48 +- tests/posture_check_mfa_test.go | 24 +- tests/posture_check_os_test.go | 16 +- tests/posture_check_process_multi_test.go | 163 +- tests/posture_check_session_test.go | 22 +- tests/router_identities_test.go | 66 +- tests/service_edge_router_policy_test.go | 108 +- tests/service_list_refresh_test.go | 258 +- tests/service_policy_test.go | 108 +- tests/service_test.go | 168 +- tests/specs_test.go | 16 +- tests/standard_error_test.go | 6 +- tests/terminator_test.go | 12 +- tests/terminator_update_test.go | 14 +- tests/transit_router_test.go | 16 +- tests/tunneler_data_flow_test.go | 60 +- 1724 files changed, 113845 insertions(+), 26801 deletions(-) delete mode 100644 controller/internal/routes/geo_region_api_model.go delete mode 100644 controller/internal/routes/geo_region_router.go rename controller/internal/routes/{transit_router_api_model.go => router_api_model.go} (90%) create mode 100644 controller/internal/routes/router_router.go delete mode 100644 controller/internal/routes/transit_router_router.go delete mode 100644 rest_client/geo_region/detail_geo_region_parameters.go delete mode 100644 rest_client/geo_region/detail_geo_region_responses.go delete mode 100644 rest_client/geo_region/list_geo_regions_parameters.go delete mode 100644 rest_client/transit_router/transit_router_client.go rename {rest_client => rest_client_api_client}/authentication/authenticate_mfa_parameters.go (79%) rename {rest_client => rest_client_api_client}/authentication/authenticate_mfa_responses.go (95%) rename {rest_client => rest_client_api_client}/authentication/authenticate_parameters.go (81%) rename {rest_client => rest_client_api_client}/authentication/authenticate_responses.go (94%) rename {rest_client => rest_client_api_client}/authentication/authentication_client.go (86%) rename {rest_client => rest_client_api_client}/current_api_session/create_current_api_session_certificate_parameters.go (79%) rename {rest_client => rest_client_api_client}/current_api_session/create_current_api_session_certificate_responses.go (94%) rename {rest_client => rest_client_api_client}/current_api_session/current_api_session_client.go (83%) rename {rest_client => rest_client_api_client}/current_api_session/delete_current_api_session_certificate_parameters.go (78%) rename {rest_client => rest_client_api_client}/current_api_session/delete_current_api_session_certificate_responses.go (94%) rename {rest_client => rest_client_api_client}/current_api_session/delete_current_api_session_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_api_session/delete_current_api_session_responses.go (95%) rename {rest_client => rest_client_api_client}/current_api_session/detail_current_api_session_certificate_parameters.go (78%) rename {rest_client => rest_client_api_client}/current_api_session/detail_current_api_session_certificate_responses.go (94%) rename {rest_client => rest_client_api_client}/current_api_session/detail_current_identity_authenticator_parameters.go (78%) rename {rest_client => rest_client_api_client}/current_api_session/detail_current_identity_authenticator_responses.go (94%) rename {rest_client => rest_client_api_client}/current_api_session/get_current_api_session_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_api_session/get_current_api_session_responses.go (95%) rename {rest_client => rest_client_api_client}/current_api_session/list_current_api_session_certificates_parameters.go (83%) rename {rest_client => rest_client_api_client}/current_api_session/list_current_api_session_certificates_responses.go (96%) rename {rest_client => rest_client_api_client}/current_api_session/list_current_identity_authenticators_parameters.go (83%) rename {rest_client => rest_client_api_client}/current_api_session/list_current_identity_authenticators_responses.go (95%) rename {rest_client => rest_client_api_client}/current_api_session/list_service_updates_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_api_session/list_service_updates_responses.go (95%) rename {rest_client => rest_client_api_client}/current_api_session/patch_current_identity_authenticator_parameters.go (80%) rename {rest_client => rest_client_api_client}/current_api_session/patch_current_identity_authenticator_responses.go (93%) rename {rest_client => rest_client_api_client}/current_api_session/update_current_identity_authenticator_parameters.go (80%) rename {rest_client => rest_client_api_client}/current_api_session/update_current_identity_authenticator_responses.go (93%) rename {rest_client => rest_client_api_client}/current_identity/create_mfa_recovery_codes_parameters.go (79%) rename {rest_client => rest_client_api_client}/current_identity/create_mfa_recovery_codes_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/current_identity_client.go (85%) rename {rest_client => rest_client_api_client}/current_identity/delete_mfa_parameters.go (80%) rename {rest_client => rest_client_api_client}/current_identity/delete_mfa_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_parameters.go (76%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_qr_code_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_qr_code_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_recovery_codes_parameters.go (81%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_recovery_codes_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/detail_mfa_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/enroll_mfa_parameters.go (76%) rename {rest_client => rest_client_api_client}/current_identity/enroll_mfa_responses.go (94%) rename {rest_client => rest_client_api_client}/current_identity/get_current_identity_edge_routers_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_identity/get_current_identity_edge_routers_responses.go (95%) rename {rest_client => rest_client_api_client}/current_identity/get_current_identity_parameters.go (77%) rename {rest_client => rest_client_api_client}/current_identity/get_current_identity_responses.go (95%) rename {rest_client => rest_client_api_client}/current_identity/verify_mfa_parameters.go (78%) rename {rest_client => rest_client_api_client}/current_identity/verify_mfa_responses.go (94%) rename {rest_client => rest_client_api_client}/enroll/enroll_ca_parameters.go (75%) rename {rest_client => rest_client_api_client}/enroll/enroll_ca_responses.go (95%) rename {rest_client => rest_client_api_client}/enroll/enroll_client.go (83%) rename {rest_client => rest_client_api_client}/enroll/enroll_er_ott_parameters.go (77%) rename {rest_client => rest_client_api_client}/enroll/enroll_er_ott_responses.go (96%) rename {rest_client => rest_client_api_client}/enroll/enroll_ott_ca_parameters.go (77%) rename {rest_client => rest_client_api_client}/enroll/enroll_ott_ca_responses.go (96%) rename {rest_client => rest_client_api_client}/enroll/enroll_ott_parameters.go (77%) rename {rest_client => rest_client_api_client}/enroll/enroll_ott_responses.go (95%) rename {rest_client => rest_client_api_client}/enroll/enroll_parameters.go (78%) rename {rest_client => rest_client_api_client}/enroll/enroll_responses.go (95%) rename {rest_client => rest_client_api_client}/enroll/ernoll_updb_parameters.go (77%) rename {rest_client => rest_client_api_client}/enroll/ernoll_updb_responses.go (95%) rename {rest_client => rest_client_api_client}/enroll/extend_router_enrollment_parameters.go (80%) rename {rest_client => rest_client_api_client}/enroll/extend_router_enrollment_responses.go (95%) rename {rest_client => rest_client_api_client}/informational/detail_spec_body_parameters.go (78%) rename {rest_client => rest_client_api_client}/informational/detail_spec_body_responses.go (96%) rename {rest_client => rest_client_api_client}/informational/detail_spec_parameters.go (77%) rename {rest_client => rest_client_api_client}/informational/detail_spec_responses.go (96%) create mode 100644 rest_client_api_client/informational/informational_client.go rename {rest_client => rest_client_api_client}/informational/list_protocols_parameters.go (77%) rename {rest_client => rest_client_api_client}/informational/list_protocols_responses.go (96%) rename {rest_client => rest_client_api_client}/informational/list_root_parameters.go (76%) rename {rest_client => rest_client_api_client}/informational/list_root_responses.go (96%) rename {rest_client => rest_client_api_client}/informational/list_specs_parameters.go (76%) rename {rest_client => rest_client_api_client}/informational/list_specs_responses.go (96%) rename {rest_client => rest_client_api_client}/informational/list_version_parameters.go (76%) rename {rest_client => rest_client_api_client}/informational/list_version_responses.go (96%) rename {rest_client => rest_client_api_client}/posture_checks/create_posture_response_bulk_parameters.go (79%) rename {rest_client => rest_client_api_client}/posture_checks/create_posture_response_bulk_responses.go (94%) rename {rest_client => rest_client_api_client}/posture_checks/create_posture_response_parameters.go (79%) rename {rest_client => rest_client_api_client}/posture_checks/create_posture_response_responses.go (94%) create mode 100644 rest_client_api_client/posture_checks/posture_checks_client.go rename {rest_client => rest_client_api_client}/service/delete_service_parameters.go (78%) rename {rest_client => rest_client_api_client}/service/delete_service_responses.go (94%) rename {rest_client => rest_client_api_client}/service/detail_service_parameters.go (78%) rename {rest_client => rest_client_api_client}/service/detail_service_responses.go (94%) rename {rest_client => rest_client_api_client}/service/list_service_terminators_parameters.go (83%) create mode 100644 rest_client_api_client/service/list_service_terminators_responses.go rename {rest_client => rest_client_api_client}/service/list_services_parameters.go (77%) rename {rest_client => rest_client_api_client}/service/list_services_responses.go (95%) rename {rest_client => rest_client_api_client}/service/patch_service_parameters.go (79%) rename {rest_client => rest_client_api_client}/service/patch_service_responses.go (94%) create mode 100644 rest_client_api_client/service/service_client.go rename {rest_client => rest_client_api_client}/service/update_service_parameters.go (79%) rename {rest_client => rest_client_api_client}/service/update_service_responses.go (94%) rename {rest_client => rest_client_api_client}/session/create_session_parameters.go (79%) rename {rest_client => rest_client_api_client}/session/create_session_responses.go (94%) rename {rest_client => rest_client_api_client}/session/delete_session_parameters.go (78%) rename {rest_client => rest_client_api_client}/session/delete_session_responses.go (94%) rename {rest_client => rest_client_api_client}/session/detail_session_parameters.go (78%) rename {rest_client => rest_client_api_client}/session/detail_session_responses.go (94%) rename {rest_client => rest_client_api_client}/session/list_sessions_parameters.go (83%) rename {rest_client => rest_client_api_client}/session/list_sessions_responses.go (95%) create mode 100644 rest_client_api_client/session/session_client.go rename {rest_client => rest_client_api_client}/well_known/list_well_known_cas_parameters.go (77%) rename {rest_client => rest_client_api_client}/well_known/list_well_known_cas_responses.go (96%) rename {rest_client => rest_client_api_client}/well_known/well_known_client.go (89%) create mode 100644 rest_client_api_client/ziti_edge_client_client.go create mode 100644 rest_client_api_server/configure_ziti_edge_client.go rename {rest_server => rest_client_api_server}/doc.go (91%) create mode 100644 rest_client_api_server/embedded_spec.go rename {rest_server => rest_client_api_server}/operations/authentication/authenticate.go (96%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_mfa.go (93%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_mfa_parameters.go (91%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_mfa_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_mfa_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_parameters.go (94%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/authentication/authenticate_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/create_current_api_session_certificate.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/create_current_api_session_certificate_parameters.go (92%) rename {rest_server => rest_client_api_server}/operations/current_api_session/create_current_api_session_certificate_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_certificate.go (92%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_certificate_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_certificate_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/delete_current_api_session_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_api_session_certificate.go (92%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_api_session_certificate_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_api_session_certificate_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_identity_authenticator.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_identity_authenticator_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_identity_authenticator_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/get_current_api_session.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/get_current_api_session_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_api_session/get_current_api_session_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/get_current_api_session_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_api_session_certificates.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_api_session_certificates_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_api_session_certificates_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_identity_authenticators.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_identity_authenticators_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_identity_authenticators_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_service_updates.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_service_updates_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_service_updates_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/list_service_updates_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/patch_current_identity_authenticator.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/patch_current_identity_authenticator_parameters.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/patch_current_identity_authenticator_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_api_session/update_current_identity_authenticator.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/update_current_identity_authenticator_parameters.go (93%) rename {rest_server => rest_client_api_server}/operations/current_api_session/update_current_identity_authenticator_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/create_mfa_recovery_codes.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/create_mfa_recovery_codes_parameters.go (92%) rename {rest_server => rest_client_api_server}/operations/current_identity/create_mfa_recovery_codes_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/delete_mfa.go (94%) rename {rest_server => rest_client_api_server}/operations/current_identity/delete_mfa_parameters.go (92%) rename {rest_server => rest_client_api_server}/operations/current_identity/delete_mfa_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/delete_mfa_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa.go (94%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_qr_code.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_qr_code_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_qr_code_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_qr_code_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_recovery_codes.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_recovery_codes_parameters.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_recovery_codes_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/detail_mfa_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/enroll_mfa.go (94%) rename {rest_server => rest_client_api_server}/operations/current_identity/enroll_mfa_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_identity/enroll_mfa_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/enroll_mfa_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_edge_routers.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_edge_routers_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_edge_routers_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/get_current_identity_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/current_identity/verify_mfa.go (93%) rename {rest_server => rest_client_api_server}/operations/current_identity/verify_mfa_parameters.go (91%) rename {rest_server => rest_client_api_server}/operations/current_identity/verify_mfa_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/current_identity/verify_mfa_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ca.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ca_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ca_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ca_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_er_ott.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_er_ott_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_er_ott_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_er_ott_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_ca.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_ca_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_ca_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_ca_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_ott_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/enroll_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/ernoll_updb.go (97%) rename {rest_server => rest_client_api_server}/operations/enroll/ernoll_updb_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/enroll/ernoll_updb_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/ernoll_updb_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/enroll/extend_router_enrollment.go (96%) rename {rest_server => rest_client_api_server}/operations/enroll/extend_router_enrollment_parameters.go (92%) rename {rest_server => rest_client_api_server}/operations/enroll/extend_router_enrollment_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/enroll/extend_router_enrollment_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec.go (96%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_body.go (96%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_body_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_body_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_body_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/detail_spec_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/list_protocols.go (96%) rename {rest_server => rest_client_api_server}/operations/informational/list_protocols_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_protocols_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/list_protocols_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/list_root.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_root_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_root_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/list_root_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/list_specs.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_specs_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_specs_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/list_specs_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/informational/list_version.go (96%) rename {rest_server => rest_client_api_server}/operations/informational/list_version_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/informational/list_version_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/informational/list_version_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response.go (93%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_bulk.go (93%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_bulk_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_bulk_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_bulk_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_parameters.go (92%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/posture_checks/create_posture_response_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/delete_service.go (94%) rename {rest_server => rest_client_api_server}/operations/service/delete_service_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/service/delete_service_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/service/delete_service_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/detail_service.go (94%) rename {rest_server => rest_client_api_server}/operations/service/detail_service_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/service/detail_service_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/service/detail_service_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/list_service_terminators.go (93%) rename {rest_server => rest_client_api_server}/operations/service/list_service_terminators_parameters.go (98%) create mode 100644 rest_client_api_server/operations/service/list_service_terminators_responses.go rename {rest_server => rest_client_api_server}/operations/service/list_service_terminators_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/list_services.go (94%) rename {rest_server => rest_client_api_server}/operations/service/list_services_parameters.go (99%) rename {rest_server => rest_client_api_server}/operations/service/list_services_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/service/list_services_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/patch_service.go (94%) rename {rest_server => rest_client_api_server}/operations/service/patch_service_parameters.go (93%) rename {rest_server => rest_client_api_server}/operations/service/patch_service_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/service/patch_service_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/service/update_service.go (94%) rename {rest_server => rest_client_api_server}/operations/service/update_service_parameters.go (93%) rename {rest_server => rest_client_api_server}/operations/service/update_service_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/service/update_service_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/session/create_session.go (93%) rename {rest_server => rest_client_api_server}/operations/session/create_session_parameters.go (91%) rename {rest_server => rest_client_api_server}/operations/session/create_session_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/session/create_session_urlbuilder.go (99%) create mode 100644 rest_client_api_server/operations/session/delete_session.go rename {rest_server => rest_client_api_server}/operations/session/delete_session_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/session/delete_session_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/session/delete_session_urlbuilder.go (99%) create mode 100644 rest_client_api_server/operations/session/detail_session.go rename {rest_server => rest_client_api_server}/operations/session/detail_session_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/session/detail_session_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/session/detail_session_urlbuilder.go (99%) create mode 100644 rest_client_api_server/operations/session/list_sessions.go rename {rest_server => rest_client_api_server}/operations/session/list_sessions_parameters.go (98%) rename {rest_server => rest_client_api_server}/operations/session/list_sessions_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/session/list_sessions_urlbuilder.go (99%) rename {rest_server => rest_client_api_server}/operations/well_known/list_well_known_cas.go (96%) rename {rest_server => rest_client_api_server}/operations/well_known/list_well_known_cas_parameters.go (97%) rename {rest_server => rest_client_api_server}/operations/well_known/list_well_known_cas_responses.go (100%) rename {rest_server => rest_client_api_server}/operations/well_known/list_well_known_cas_urlbuilder.go (99%) create mode 100644 rest_client_api_server/operations/ziti_edge_client_api.go rename {rest_server => rest_client_api_server}/server.go (94%) rename {rest_client => rest_management_api_client}/api_session/api_session_client.go (85%) rename {rest_client => rest_management_api_client}/api_session/delete_api_sessions_parameters.go (78%) rename {rest_client => rest_management_api_client}/api_session/delete_api_sessions_responses.go (94%) rename {rest_client => rest_management_api_client}/api_session/detail_api_sessions_parameters.go (78%) rename {rest_client => rest_management_api_client}/api_session/detail_api_sessions_responses.go (94%) rename {rest_client => rest_management_api_client}/api_session/list_api_sessions_parameters.go (83%) rename {rest_client => rest_management_api_client}/api_session/list_api_sessions_responses.go (96%) create mode 100644 rest_management_api_client/authentication/authenticate_mfa_parameters.go create mode 100644 rest_management_api_client/authentication/authenticate_mfa_responses.go create mode 100644 rest_management_api_client/authentication/authenticate_parameters.go create mode 100644 rest_management_api_client/authentication/authenticate_responses.go rename rest_client/geo_region/geo_region_client.go => rest_management_api_client/authentication/authentication_client.go (59%) rename {rest_client => rest_management_api_client}/authenticator/authenticator_client.go (83%) rename {rest_client => rest_management_api_client}/authenticator/create_authenticator_parameters.go (79%) rename {rest_client => rest_management_api_client}/authenticator/create_authenticator_responses.go (94%) rename {rest_client => rest_management_api_client}/authenticator/delete_authenticator_parameters.go (78%) rename {rest_client => rest_management_api_client}/authenticator/delete_authenticator_responses.go (94%) rename {rest_client => rest_management_api_client}/authenticator/detail_authenticator_parameters.go (78%) rename {rest_client => rest_management_api_client}/authenticator/detail_authenticator_responses.go (94%) rename {rest_client => rest_management_api_client}/authenticator/list_authenticators_parameters.go (77%) rename {rest_client => rest_management_api_client}/authenticator/list_authenticators_responses.go (96%) rename {rest_client => rest_management_api_client}/authenticator/patch_authenticator_parameters.go (80%) rename {rest_client => rest_management_api_client}/authenticator/patch_authenticator_responses.go (94%) rename {rest_client => rest_management_api_client}/authenticator/update_authenticator_parameters.go (80%) rename {rest_client => rest_management_api_client}/authenticator/update_authenticator_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/certificate_authority_client.go (85%) rename {rest_client => rest_management_api_client}/certificate_authority/create_ca_parameters.go (77%) rename {rest_client => rest_management_api_client}/certificate_authority/create_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/delete_ca_parameters.go (77%) rename {rest_client => rest_management_api_client}/certificate_authority/delete_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/detail_ca_parameters.go (77%) rename {rest_client => rest_management_api_client}/certificate_authority/detail_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/get_ca_jwt_parameters.go (77%) rename {rest_client => rest_management_api_client}/certificate_authority/get_ca_jwt_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/list_cas_parameters.go (82%) rename {rest_client => rest_management_api_client}/certificate_authority/list_cas_responses.go (96%) rename {rest_client => rest_management_api_client}/certificate_authority/patch_ca_parameters.go (78%) rename {rest_client => rest_management_api_client}/certificate_authority/patch_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/update_ca_parameters.go (78%) rename {rest_client => rest_management_api_client}/certificate_authority/update_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/certificate_authority/verify_ca_parameters.go (77%) rename {rest_client => rest_management_api_client}/certificate_authority/verify_ca_responses.go (94%) rename {rest_client => rest_management_api_client}/config/config_client.go (83%) rename {rest_client => rest_management_api_client}/config/create_config_parameters.go (79%) rename {rest_client => rest_management_api_client}/config/create_config_responses.go (94%) rename {rest_client => rest_management_api_client}/config/create_config_type_parameters.go (79%) rename {rest_client => rest_management_api_client}/config/create_config_type_responses.go (94%) rename {rest_client => rest_management_api_client}/config/delete_config_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/delete_config_responses.go (94%) rename {rest_client => rest_management_api_client}/config/delete_config_type_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/delete_config_type_responses.go (94%) rename {rest_client => rest_management_api_client}/config/detail_config_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/detail_config_responses.go (94%) rename {rest_client => rest_management_api_client}/config/detail_config_type_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/detail_config_type_responses.go (94%) rename {rest_client => rest_management_api_client}/config/list_config_types_parameters.go (83%) rename {rest_client => rest_management_api_client}/config/list_config_types_responses.go (96%) rename {rest_client => rest_management_api_client}/config/list_configs_for_config_type_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/list_configs_for_config_type_responses.go (96%) rename {rest_client => rest_management_api_client}/config/list_configs_parameters.go (82%) rename {rest_client => rest_management_api_client}/config/list_configs_responses.go (95%) rename {rest_client => rest_management_api_client}/config/patch_config_parameters.go (78%) rename {rest_client => rest_management_api_client}/config/patch_config_responses.go (94%) rename {rest_client => rest_management_api_client}/config/patch_config_type_parameters.go (80%) rename {rest_client => rest_management_api_client}/config/patch_config_type_responses.go (94%) rename {rest_client => rest_management_api_client}/config/update_config_parameters.go (79%) rename {rest_client => rest_management_api_client}/config/update_config_responses.go (94%) rename {rest_client => rest_management_api_client}/config/update_config_type_parameters.go (80%) rename {rest_client => rest_management_api_client}/config/update_config_type_responses.go (94%) create mode 100644 rest_management_api_client/current_api_session/current_api_session_client.go create mode 100644 rest_management_api_client/current_api_session/delete_current_api_session_parameters.go create mode 100644 rest_management_api_client/current_api_session/delete_current_api_session_responses.go create mode 100644 rest_management_api_client/current_api_session/detail_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_client/current_api_session/detail_current_identity_authenticator_responses.go create mode 100644 rest_management_api_client/current_api_session/get_current_api_session_parameters.go create mode 100644 rest_management_api_client/current_api_session/get_current_api_session_responses.go create mode 100644 rest_management_api_client/current_api_session/list_current_identity_authenticators_parameters.go create mode 100644 rest_management_api_client/current_api_session/list_current_identity_authenticators_responses.go create mode 100644 rest_management_api_client/current_api_session/patch_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_client/current_api_session/patch_current_identity_authenticator_responses.go create mode 100644 rest_management_api_client/current_api_session/update_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_client/current_api_session/update_current_identity_authenticator_responses.go create mode 100644 rest_management_api_client/current_identity/create_mfa_recovery_codes_parameters.go create mode 100644 rest_management_api_client/current_identity/create_mfa_recovery_codes_responses.go create mode 100644 rest_management_api_client/current_identity/current_identity_client.go create mode 100644 rest_management_api_client/current_identity/delete_mfa_parameters.go create mode 100644 rest_management_api_client/current_identity/delete_mfa_responses.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_parameters.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_qr_code_parameters.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_qr_code_responses.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_recovery_codes_parameters.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_recovery_codes_responses.go create mode 100644 rest_management_api_client/current_identity/detail_mfa_responses.go create mode 100644 rest_management_api_client/current_identity/enroll_mfa_parameters.go create mode 100644 rest_management_api_client/current_identity/enroll_mfa_responses.go create mode 100644 rest_management_api_client/current_identity/get_current_identity_parameters.go create mode 100644 rest_management_api_client/current_identity/get_current_identity_responses.go create mode 100644 rest_management_api_client/current_identity/verify_mfa_parameters.go create mode 100644 rest_management_api_client/current_identity/verify_mfa_responses.go rename {rest_client => rest_management_api_client}/database/check_data_integrity_parameters.go (77%) rename {rest_client => rest_management_api_client}/database/check_data_integrity_responses.go (94%) rename {rest_client => rest_management_api_client}/database/create_database_snapshot_parameters.go (77%) rename {rest_client => rest_management_api_client}/database/create_database_snapshot_responses.go (94%) rename {rest_client => rest_management_api_client}/database/data_integrity_results_parameters.go (77%) rename {rest_client => rest_management_api_client}/database/data_integrity_results_responses.go (95%) rename {rest_client => rest_management_api_client}/database/database_client.go (84%) rename {rest_client => rest_management_api_client}/database/fix_data_integrity_parameters.go (77%) rename {rest_client => rest_management_api_client}/database/fix_data_integrity_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/create_edge_router_parameters.go (79%) rename {rest_client => rest_management_api_client}/edge_router/create_edge_router_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/delete_edge_router_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router/delete_edge_router_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/detail_edge_router_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router/detail_edge_router_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/edge_router_client.go (83%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_edge_router_policies_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_edge_router_policies_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_identities_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_identities_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_service_edge_router_policies_parameters.go (79%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_service_edge_router_policies_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_services_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_router_services_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_routers_parameters.go (77%) rename {rest_client => rest_management_api_client}/edge_router/list_edge_routers_responses.go (95%) rename {rest_client => rest_management_api_client}/edge_router/patch_edge_router_parameters.go (80%) rename {rest_client => rest_management_api_client}/edge_router/patch_edge_router_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router/update_edge_router_parameters.go (80%) rename {rest_client => rest_management_api_client}/edge_router/update_edge_router_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/create_edge_router_policy_parameters.go (79%) rename {rest_client => rest_management_api_client}/edge_router_policy/create_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/delete_edge_router_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router_policy/delete_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/detail_edge_router_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router_policy/detail_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/edge_router_policy_client.go (83%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policies_parameters.go (83%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policies_responses.go (95%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policy_edge_routers_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policy_identities_parameters.go (78%) rename {rest_client => rest_management_api_client}/edge_router_policy/list_edge_router_policy_identities_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/patch_edge_router_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/edge_router_policy/patch_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/edge_router_policy/update_edge_router_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/edge_router_policy/update_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/enrollment/delete_enrollment_parameters.go (78%) rename {rest_client => rest_management_api_client}/enrollment/delete_enrollment_responses.go (94%) rename {rest_client => rest_management_api_client}/enrollment/detail_enrollment_parameters.go (78%) rename {rest_client => rest_management_api_client}/enrollment/detail_enrollment_responses.go (94%) rename {rest_client => rest_management_api_client}/enrollment/enrollment_client.go (85%) rename {rest_client => rest_management_api_client}/enrollment/list_enrollments_parameters.go (83%) rename {rest_client => rest_management_api_client}/enrollment/list_enrollments_responses.go (95%) rename {rest_client => rest_management_api_client}/identity/associate_identitys_service_configs_parameters.go (80%) rename {rest_client => rest_management_api_client}/identity/associate_identitys_service_configs_responses.go (93%) rename {rest_client => rest_management_api_client}/identity/create_identity_parameters.go (79%) rename {rest_client => rest_management_api_client}/identity/create_identity_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/delete_identity_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/delete_identity_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/detail_identity_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/detail_identity_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/detail_identity_type_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/detail_identity_type_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/disassociate_identitys_service_configs_parameters.go (80%) rename {rest_client => rest_management_api_client}/identity/disassociate_identitys_service_configs_responses.go (93%) rename {rest_client => rest_management_api_client}/identity/get_identity_failed_service_requests_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/get_identity_failed_service_requests_responses.go (92%) rename {rest_client => rest_management_api_client}/identity/get_identity_policy_advice_parameters.go (80%) rename {rest_client => rest_management_api_client}/identity/get_identity_policy_advice_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/get_identity_posture_data_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/get_identity_posture_data_responses.go (91%) rename {rest_client => rest_management_api_client}/identity/identity_client.go (82%) rename {rest_client => rest_management_api_client}/identity/list_identities_parameters.go (77%) rename {rest_client => rest_management_api_client}/identity/list_identities_responses.go (95%) rename {rest_client => rest_management_api_client}/identity/list_identity_edge_routers_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/list_identity_edge_routers_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/list_identity_service_policies_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/list_identity_service_policies_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/list_identity_services_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/list_identity_services_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/list_identity_types_parameters.go (83%) rename {rest_client => rest_management_api_client}/identity/list_identity_types_responses.go (95%) rename {rest_client => rest_management_api_client}/identity/list_identitys_edge_router_policies_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/list_identitys_edge_router_policies_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/list_identitys_service_configs_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/list_identitys_service_configs_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/patch_identity_parameters.go (79%) rename {rest_client => rest_management_api_client}/identity/patch_identity_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/remove_identity_mfa_parameters.go (78%) rename {rest_client => rest_management_api_client}/identity/remove_identity_mfa_responses.go (94%) rename {rest_client => rest_management_api_client}/identity/update_identity_parameters.go (79%) rename {rest_client => rest_management_api_client}/identity/update_identity_responses.go (94%) create mode 100644 rest_management_api_client/informational/detail_spec_body_parameters.go create mode 100644 rest_management_api_client/informational/detail_spec_body_responses.go create mode 100644 rest_management_api_client/informational/detail_spec_parameters.go create mode 100644 rest_management_api_client/informational/detail_spec_responses.go rename {rest_client => rest_management_api_client}/informational/informational_client.go (77%) create mode 100644 rest_management_api_client/informational/list_root_parameters.go create mode 100644 rest_management_api_client/informational/list_root_responses.go create mode 100644 rest_management_api_client/informational/list_specs_parameters.go create mode 100644 rest_management_api_client/informational/list_specs_responses.go rename {rest_client => rest_management_api_client}/informational/list_summary_parameters.go (76%) rename {rest_client => rest_management_api_client}/informational/list_summary_responses.go (95%) create mode 100644 rest_management_api_client/informational/list_version_parameters.go create mode 100644 rest_management_api_client/informational/list_version_responses.go rename {rest_client => rest_management_api_client}/posture_checks/create_posture_check_parameters.go (79%) rename {rest_client => rest_management_api_client}/posture_checks/create_posture_check_responses.go (94%) rename {rest_client => rest_management_api_client}/posture_checks/delete_posture_check_parameters.go (78%) rename {rest_client => rest_management_api_client}/posture_checks/delete_posture_check_responses.go (94%) rename {rest_client => rest_management_api_client}/posture_checks/detail_posture_check_parameters.go (78%) rename {rest_client => rest_management_api_client}/posture_checks/detail_posture_check_responses.go (94%) rename {rest_client => rest_management_api_client}/posture_checks/detail_posture_check_type_parameters.go (78%) rename {rest_client => rest_management_api_client}/posture_checks/detail_posture_check_type_responses.go (94%) rename {rest_client => rest_management_api_client}/posture_checks/list_posture_check_types_parameters.go (83%) rename {rest_client => rest_management_api_client}/posture_checks/list_posture_check_types_responses.go (96%) rename {rest_client => rest_management_api_client}/posture_checks/list_posture_checks_parameters.go (78%) rename {rest_client => rest_management_api_client}/posture_checks/list_posture_checks_responses.go (96%) rename {rest_client => rest_management_api_client}/posture_checks/patch_posture_check_parameters.go (80%) rename {rest_client => rest_management_api_client}/posture_checks/patch_posture_check_responses.go (94%) rename {rest_client => rest_management_api_client}/posture_checks/posture_checks_client.go (72%) rename {rest_client => rest_management_api_client}/posture_checks/update_posture_check_parameters.go (80%) rename {rest_client => rest_management_api_client}/posture_checks/update_posture_check_responses.go (94%) rename {rest_client => rest_management_api_client}/role_attributes/list_edge_router_role_attributes_parameters.go (83%) rename {rest_client => rest_management_api_client}/role_attributes/list_edge_router_role_attributes_responses.go (95%) rename {rest_client => rest_management_api_client}/role_attributes/list_identity_role_attributes_parameters.go (83%) rename {rest_client => rest_management_api_client}/role_attributes/list_identity_role_attributes_responses.go (95%) rename {rest_client => rest_management_api_client}/role_attributes/list_service_role_attributes_parameters.go (83%) rename {rest_client => rest_management_api_client}/role_attributes/list_service_role_attributes_responses.go (95%) rename {rest_client => rest_management_api_client}/role_attributes/role_attributes_client.go (84%) create mode 100644 rest_management_api_client/router/create_router_parameters.go create mode 100644 rest_management_api_client/router/create_router_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/create_transit_router_parameters.go (77%) rename {rest_client/transit_router => rest_management_api_client/router}/create_transit_router_responses.go (94%) create mode 100644 rest_management_api_client/router/delete_router_parameters.go create mode 100644 rest_management_api_client/router/delete_router_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/delete_transit_router_parameters.go (78%) rename {rest_client/transit_router => rest_management_api_client/router}/delete_transit_router_responses.go (93%) create mode 100644 rest_management_api_client/router/detail_router_parameters.go create mode 100644 rest_management_api_client/router/detail_router_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/detail_transit_router_parameters.go (78%) rename {rest_client/transit_router => rest_management_api_client/router}/detail_transit_router_responses.go (90%) create mode 100644 rest_management_api_client/router/list_routers_parameters.go create mode 100644 rest_management_api_client/router/list_routers_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/list_transit_routers_parameters.go (82%) rename {rest_client/transit_router => rest_management_api_client/router}/list_transit_routers_responses.go (91%) create mode 100644 rest_management_api_client/router/patch_router_parameters.go create mode 100644 rest_management_api_client/router/patch_router_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/patch_transit_router_parameters.go (78%) rename {rest_client/transit_router => rest_management_api_client/router}/patch_transit_router_responses.go (93%) create mode 100644 rest_management_api_client/router/router_client.go create mode 100644 rest_management_api_client/router/update_router_parameters.go create mode 100644 rest_management_api_client/router/update_router_responses.go rename {rest_client/transit_router => rest_management_api_client/router}/update_transit_router_parameters.go (78%) rename {rest_client/transit_router => rest_management_api_client/router}/update_transit_router_responses.go (93%) rename {rest_client => rest_management_api_client}/service/create_service_parameters.go (79%) rename {rest_client => rest_management_api_client}/service/create_service_responses.go (94%) create mode 100644 rest_management_api_client/service/delete_service_parameters.go create mode 100644 rest_management_api_client/service/delete_service_responses.go create mode 100644 rest_management_api_client/service/detail_service_parameters.go create mode 100644 rest_management_api_client/service/detail_service_responses.go rename {rest_client => rest_management_api_client}/service/list_service_config_parameters.go (83%) rename {rest_client => rest_management_api_client}/service/list_service_config_responses.go (95%) rename {rest_client => rest_management_api_client}/service/list_service_edge_routers_parameters.go (83%) rename {rest_client => rest_management_api_client}/service/list_service_edge_routers_responses.go (95%) rename {rest_client => rest_management_api_client}/service/list_service_identities_parameters.go (83%) rename {rest_client => rest_management_api_client}/service/list_service_identities_responses.go (95%) rename {rest_client => rest_management_api_client}/service/list_service_service_edge_router_policies_parameters.go (83%) rename {rest_client => rest_management_api_client}/service/list_service_service_edge_router_policies_responses.go (95%) rename {rest_client => rest_management_api_client}/service/list_service_service_policies_parameters.go (83%) rename {rest_client => rest_management_api_client}/service/list_service_service_policies_responses.go (95%) create mode 100644 rest_management_api_client/service/list_service_terminators_parameters.go rename {rest_client => rest_management_api_client}/service/list_service_terminators_responses.go (95%) create mode 100644 rest_management_api_client/service/list_services_parameters.go rename rest_client/geo_region/list_geo_regions_responses.go => rest_management_api_client/service/list_services_responses.go (58%) create mode 100644 rest_management_api_client/service/patch_service_parameters.go create mode 100644 rest_management_api_client/service/patch_service_responses.go rename {rest_client => rest_management_api_client}/service/service_client.go (83%) create mode 100644 rest_management_api_client/service/update_service_parameters.go create mode 100644 rest_management_api_client/service/update_service_responses.go rename {rest_client => rest_management_api_client}/service_edge_router_policy/create_service_edge_router_policy_parameters.go (79%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/create_service_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/delete_service_edge_router_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/delete_service_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/detail_service_edge_router_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/detail_service_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policies_parameters.go (83%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policies_responses.go (95%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go (79%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go (79%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/list_service_edge_router_policy_services_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/patch_service_edge_router_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/patch_service_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/service_edge_router_policy_client.go (84%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/update_service_edge_router_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/service_edge_router_policy/update_service_edge_router_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/create_service_policy_parameters.go (79%) rename {rest_client => rest_management_api_client}/service_policy/create_service_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/delete_service_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/service_policy/delete_service_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/detail_service_policy_parameters.go (78%) rename {rest_client => rest_management_api_client}/service_policy/detail_service_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policies_parameters.go (83%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policies_responses.go (95%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_identities_parameters.go (83%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_identities_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_posture_checks_parameters.go (83%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_posture_checks_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_services_parameters.go (83%) rename {rest_client => rest_management_api_client}/service_policy/list_service_policy_services_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/patch_service_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/service_policy/patch_service_policy_responses.go (94%) rename {rest_client => rest_management_api_client}/service_policy/service_policy_client.go (82%) rename {rest_client => rest_management_api_client}/service_policy/update_service_policy_parameters.go (80%) rename {rest_client => rest_management_api_client}/service_policy/update_service_policy_responses.go (94%) create mode 100644 rest_management_api_client/session/delete_session_parameters.go create mode 100644 rest_management_api_client/session/delete_session_responses.go create mode 100644 rest_management_api_client/session/detail_session_parameters.go create mode 100644 rest_management_api_client/session/detail_session_responses.go rename {rest_client => rest_management_api_client}/session/detail_session_route_path_parameters.go (78%) rename {rest_client => rest_management_api_client}/session/detail_session_route_path_responses.go (94%) create mode 100644 rest_management_api_client/session/list_sessions_parameters.go create mode 100644 rest_management_api_client/session/list_sessions_responses.go rename {rest_client => rest_management_api_client}/session/session_client.go (76%) rename {rest_client => rest_management_api_client}/terminator/create_terminator_parameters.go (79%) rename {rest_client => rest_management_api_client}/terminator/create_terminator_responses.go (94%) rename {rest_client => rest_management_api_client}/terminator/delete_terminator_parameters.go (78%) rename {rest_client => rest_management_api_client}/terminator/delete_terminator_responses.go (94%) rename {rest_client => rest_management_api_client}/terminator/detail_terminator_parameters.go (78%) rename {rest_client => rest_management_api_client}/terminator/detail_terminator_responses.go (94%) rename {rest_client => rest_management_api_client}/terminator/list_terminators_parameters.go (83%) rename {rest_client => rest_management_api_client}/terminator/list_terminators_responses.go (95%) rename {rest_client => rest_management_api_client}/terminator/patch_terminator_parameters.go (80%) rename {rest_client => rest_management_api_client}/terminator/patch_terminator_responses.go (94%) rename {rest_client => rest_management_api_client}/terminator/terminator_client.go (84%) rename {rest_client => rest_management_api_client}/terminator/update_terminator_parameters.go (80%) rename {rest_client => rest_management_api_client}/terminator/update_terminator_responses.go (94%) rename rest_client/ziti_edge_client.go => rest_management_api_client/ziti_edge_management_client.go (73%) rename rest_server/configure_ziti_edge.go => rest_management_api_server/configure_ziti_edge_management.go (82%) create mode 100644 rest_management_api_server/doc.go rename {rest_server => rest_management_api_server}/embedded_spec.go (68%) rename {rest_server => rest_management_api_server}/operations/api_session/delete_api_sessions.go (93%) rename {rest_server => rest_management_api_server}/operations/api_session/delete_api_sessions_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/api_session/delete_api_sessions_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/api_session/delete_api_sessions_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/api_session/detail_api_sessions.go (93%) rename {rest_server => rest_management_api_server}/operations/api_session/detail_api_sessions_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/api_session/detail_api_sessions_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/api_session/detail_api_sessions_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/api_session/list_api_sessions.go (94%) rename {rest_server => rest_management_api_server}/operations/api_session/list_api_sessions_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/api_session/list_api_sessions_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/api_session/list_api_sessions_urlbuilder.go (99%) create mode 100644 rest_management_api_server/operations/authentication/authenticate.go rename rest_server/operations/geo_region/detail_geo_region.go => rest_management_api_server/operations/authentication/authenticate_mfa.go (61%) create mode 100644 rest_management_api_server/operations/authentication/authenticate_mfa_parameters.go create mode 100644 rest_management_api_server/operations/authentication/authenticate_mfa_responses.go create mode 100644 rest_management_api_server/operations/authentication/authenticate_mfa_urlbuilder.go create mode 100644 rest_management_api_server/operations/authentication/authenticate_parameters.go create mode 100644 rest_management_api_server/operations/authentication/authenticate_responses.go create mode 100644 rest_management_api_server/operations/authentication/authenticate_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/authenticator/create_authenticator.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/create_authenticator_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/authenticator/create_authenticator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/create_authenticator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/delete_authenticator.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/delete_authenticator_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/delete_authenticator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/delete_authenticator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/detail_authenticator.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/detail_authenticator_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/detail_authenticator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/detail_authenticator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/list_authenticators.go (94%) rename {rest_server => rest_management_api_server}/operations/authenticator/list_authenticators_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/authenticator/list_authenticators_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/list_authenticators_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/patch_authenticator.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/patch_authenticator_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/patch_authenticator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/patch_authenticator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/authenticator/update_authenticator.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/update_authenticator_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/authenticator/update_authenticator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/authenticator/update_authenticator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/create_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/create_ca_parameters.go (91%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/create_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/create_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/delete_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/delete_ca_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/delete_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/delete_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/detail_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/detail_ca_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/detail_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/detail_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/get_ca_jwt.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/get_ca_jwt_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/get_ca_jwt_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/get_ca_jwt_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/list_cas.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/list_cas_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/list_cas_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/list_cas_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/patch_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/patch_ca_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/patch_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/patch_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/update_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/update_ca_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/update_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/update_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/verify_ca.go (94%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/verify_ca_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/verify_ca_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/certificate_authority/verify_ca_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/create_config.go (94%) rename {rest_server => rest_management_api_server}/operations/config/create_config_parameters.go (91%) rename {rest_server => rest_management_api_server}/operations/config/create_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/create_config_type.go (94%) rename {rest_server => rest_management_api_server}/operations/config/create_config_type_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/config/create_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/create_config_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/create_config_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/delete_config.go (94%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_type.go (94%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_type_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/delete_config_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/detail_config.go (94%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_type.go (94%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_type_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/detail_config_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/list_config_types.go (94%) rename {rest_server => rest_management_api_server}/operations/config/list_config_types_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/list_config_types_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/list_config_types_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/config/list_configs.go (94%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_for_config_type.go (93%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_for_config_type_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_for_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_for_config_type_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/list_configs_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/config/patch_config.go (94%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_type.go (94%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_type_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/patch_config_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/update_config.go (94%) rename {rest_server => rest_management_api_server}/operations/config/update_config_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/config/update_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/update_config_type.go (94%) rename {rest_server => rest_management_api_server}/operations/config/update_config_type_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/config/update_config_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/config/update_config_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/config/update_config_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/current_api_session/delete_current_api_session.go create mode 100644 rest_management_api_server/operations/current_api_session/delete_current_api_session_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/delete_current_api_session_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator.go create mode 100644 rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_api_session/get_current_api_session.go create mode 100644 rest_management_api_server/operations/current_api_session/get_current_api_session_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/get_current_api_session_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_api_session/list_current_identity_authenticators.go create mode 100644 rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator.go create mode 100644 rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_api_session/update_current_identity_authenticator.go create mode 100644 rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go create mode 100644 rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go create mode 100644 rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/create_mfa_recovery_codes.go create mode 100644 rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go create mode 100644 rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/delete_mfa.go create mode 100644 rest_management_api_server/operations/current_identity/delete_mfa_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/delete_mfa_responses.go create mode 100644 rest_management_api_server/operations/current_identity/delete_mfa_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_qr_code.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_qr_code_responses.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_responses.go create mode 100644 rest_management_api_server/operations/current_identity/detail_mfa_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/enroll_mfa.go create mode 100644 rest_management_api_server/operations/current_identity/enroll_mfa_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/enroll_mfa_responses.go create mode 100644 rest_management_api_server/operations/current_identity/enroll_mfa_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/get_current_identity.go create mode 100644 rest_management_api_server/operations/current_identity/get_current_identity_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/get_current_identity_responses.go create mode 100644 rest_management_api_server/operations/current_identity/get_current_identity_urlbuilder.go create mode 100644 rest_management_api_server/operations/current_identity/verify_mfa.go create mode 100644 rest_management_api_server/operations/current_identity/verify_mfa_parameters.go create mode 100644 rest_management_api_server/operations/current_identity/verify_mfa_responses.go create mode 100644 rest_management_api_server/operations/current_identity/verify_mfa_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/database/check_data_integrity.go (93%) rename {rest_server => rest_management_api_server}/operations/database/check_data_integrity_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/database/check_data_integrity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/database/check_data_integrity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/database/create_database_snapshot.go (93%) rename {rest_server => rest_management_api_server}/operations/database/create_database_snapshot_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/database/create_database_snapshot_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/database/create_database_snapshot_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/database/data_integrity_results.go (93%) rename {rest_server => rest_management_api_server}/operations/database/data_integrity_results_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/database/data_integrity_results_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/database/data_integrity_results_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/database/fix_data_integrity.go (94%) rename {rest_server => rest_management_api_server}/operations/database/fix_data_integrity_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/database/fix_data_integrity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/database/fix_data_integrity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/create_edge_router.go (94%) rename {rest_server => rest_management_api_server}/operations/edge_router/create_edge_router_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/edge_router/create_edge_router_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/create_edge_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/delete_edge_router.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/delete_edge_router_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/delete_edge_router_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/delete_edge_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/detail_edge_router.go (94%) rename {rest_server => rest_management_api_server}/operations/edge_router/detail_edge_router_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/detail_edge_router_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/detail_edge_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_edge_router_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_identities.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_identities_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_identities_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_identities_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_service_edge_router_policies.go (92%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_services.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_services_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_services_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_router_services_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_routers.go (94%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_routers_parameters.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_routers_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/list_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router/patch_edge_router.go (94%) rename {rest_server => rest_management_api_server}/operations/edge_router/patch_edge_router_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/patch_edge_router_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/patch_edge_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router/update_edge_router.go (94%) rename {rest_server => rest_management_api_server}/operations/edge_router/update_edge_router_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router/update_edge_router_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router/update_edge_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/create_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/create_edge_router_policy_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/create_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/delete_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/delete_edge_router_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/delete_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/detail_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/detail_edge_router_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/detail_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_edge_routers.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_identities.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_identities_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/patch_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/patch_edge_router_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/patch_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/update_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/update_edge_router_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/update_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/enrollment/delete_enrollment.go (93%) rename {rest_server => rest_management_api_server}/operations/enrollment/delete_enrollment_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/enrollment/delete_enrollment_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/enrollment/delete_enrollment_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/enrollment/detail_enrollment.go (94%) rename {rest_server => rest_management_api_server}/operations/enrollment/detail_enrollment_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/enrollment/detail_enrollment_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/enrollment/detail_enrollment_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/enrollment/list_enrollments.go (94%) rename {rest_server => rest_management_api_server}/operations/enrollment/list_enrollments_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/enrollment/list_enrollments_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/enrollment/list_enrollments_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/associate_identitys_service_configs.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/associate_identitys_service_configs_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/associate_identitys_service_configs_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/associate_identitys_service_configs_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/create_identity.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/create_identity_parameters.go (91%) rename {rest_server => rest_management_api_server}/operations/identity/create_identity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/create_identity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/delete_identity.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/delete_identity_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/delete_identity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/delete_identity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_type.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_type_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_type_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/detail_identity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/disassociate_identitys_service_configs.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/disassociate_identitys_service_configs_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/disassociate_identitys_service_configs_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/disassociate_identitys_service_configs_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_failed_service_requests.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_failed_service_requests_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_failed_service_requests_responses.go (96%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_failed_service_requests_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_policy_advice.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_policy_advice_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_policy_advice_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_policy_advice_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_posture_data.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_posture_data_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_posture_data_responses.go (96%) rename {rest_server => rest_management_api_server}/operations/identity/get_identity_posture_data_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identities.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/list_identities_parameters.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identities_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identities_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_edge_routers.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_edge_routers_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_edge_routers_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_service_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_service_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_service_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_service_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_services.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_services_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_services_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_services_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_types.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_types_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_types_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identity_types_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_edge_router_policies.go (91%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_service_configs.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_service_configs_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_service_configs_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/list_identitys_service_configs_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/identity/patch_identity.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/patch_identity_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/patch_identity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/patch_identity_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/remove_identity_mfa.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/remove_identity_mfa_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/remove_identity_mfa_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/remove_identity_mfa_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/identity/update_identity.go (94%) rename {rest_server => rest_management_api_server}/operations/identity/update_identity_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/identity/update_identity_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/identity/update_identity_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/informational/detail_spec.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_body.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_body_parameters.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_body_responses.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_body_urlbuilder.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_parameters.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_responses.go create mode 100644 rest_management_api_server/operations/informational/detail_spec_urlbuilder.go create mode 100644 rest_management_api_server/operations/informational/list_root.go create mode 100644 rest_management_api_server/operations/informational/list_root_parameters.go create mode 100644 rest_management_api_server/operations/informational/list_root_responses.go create mode 100644 rest_management_api_server/operations/informational/list_root_urlbuilder.go create mode 100644 rest_management_api_server/operations/informational/list_specs.go create mode 100644 rest_management_api_server/operations/informational/list_specs_parameters.go create mode 100644 rest_management_api_server/operations/informational/list_specs_responses.go create mode 100644 rest_management_api_server/operations/informational/list_specs_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/informational/list_summary.go (94%) rename {rest_server => rest_management_api_server}/operations/informational/list_summary_parameters.go (97%) rename {rest_server => rest_management_api_server}/operations/informational/list_summary_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/informational/list_summary_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/informational/list_version.go create mode 100644 rest_management_api_server/operations/informational/list_version_parameters.go create mode 100644 rest_management_api_server/operations/informational/list_version_responses.go create mode 100644 rest_management_api_server/operations/informational/list_version_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/posture_checks/create_posture_check.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/create_posture_check_parameters.go (91%) rename {rest_server => rest_management_api_server}/operations/posture_checks/create_posture_check_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/create_posture_check_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/delete_posture_check.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/delete_posture_check_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/delete_posture_check_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/delete_posture_check_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_type.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_type_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_type_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_type_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/posture_checks/detail_posture_check_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_check_types.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_check_types_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_check_types_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_check_types_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_checks.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_checks_parameters.go (99%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_checks_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/list_posture_checks_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/posture_checks/patch_posture_check.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/patch_posture_check_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/patch_posture_check_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/patch_posture_check_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/posture_checks/update_posture_check.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/update_posture_check_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/posture_checks/update_posture_check_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/posture_checks/update_posture_check_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_edge_router_role_attributes.go (93%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_edge_router_role_attributes_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_edge_router_role_attributes_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_identity_role_attributes.go (93%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_identity_role_attributes_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_identity_role_attributes_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_identity_role_attributes_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_service_role_attributes.go (93%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_service_role_attributes_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_service_role_attributes_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/role_attributes/list_service_role_attributes_urlbuilder.go (99%) create mode 100644 rest_management_api_server/operations/router/create_router.go create mode 100644 rest_management_api_server/operations/router/create_router_parameters.go create mode 100644 rest_management_api_server/operations/router/create_router_responses.go create mode 100644 rest_management_api_server/operations/router/create_router_urlbuilder.go rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/create_transit_router.go (91%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/create_transit_router_parameters.go (88%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/create_transit_router_responses.go (99%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/create_transit_router_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/router/delete_router.go create mode 100644 rest_management_api_server/operations/router/delete_router_parameters.go create mode 100644 rest_management_api_server/operations/router/delete_router_responses.go create mode 100644 rest_management_api_server/operations/router/delete_router_urlbuilder.go rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/delete_transit_router.go (91%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/delete_transit_router_parameters.go (97%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/delete_transit_router_responses.go (99%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/delete_transit_router_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/router/detail_router.go create mode 100644 rest_management_api_server/operations/router/detail_router_parameters.go create mode 100644 rest_management_api_server/operations/router/detail_router_responses.go create mode 100644 rest_management_api_server/operations/router/detail_router_urlbuilder.go rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/detail_transit_router.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/detail_transit_router_parameters.go (97%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/detail_transit_router_responses.go (95%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/detail_transit_router_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/router/list_routers.go rename rest_server/operations/geo_region/list_geo_regions_parameters.go => rest_management_api_server/operations/router/list_routers_parameters.go (81%) rename rest_server/operations/geo_region/list_geo_regions_responses.go => rest_management_api_server/operations/router/list_routers_responses.go (50%) rename rest_server/operations/geo_region/list_geo_regions_urlbuilder.go => rest_management_api_server/operations/router/list_routers_urlbuilder.go (83%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/list_transit_routers.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/list_transit_routers_parameters.go (98%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/list_transit_routers_responses.go (95%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/list_transit_routers_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/router/patch_router.go create mode 100644 rest_management_api_server/operations/router/patch_router_parameters.go create mode 100644 rest_management_api_server/operations/router/patch_router_responses.go create mode 100644 rest_management_api_server/operations/router/patch_router_urlbuilder.go rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/patch_transit_router.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/patch_transit_router_parameters.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/patch_transit_router_responses.go (99%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/patch_transit_router_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/router/update_router.go create mode 100644 rest_management_api_server/operations/router/update_router_parameters.go create mode 100644 rest_management_api_server/operations/router/update_router_responses.go create mode 100644 rest_management_api_server/operations/router/update_router_urlbuilder.go rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/update_transit_router.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/update_transit_router_parameters.go (90%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/update_transit_router_responses.go (99%) rename {rest_server/operations/transit_router => rest_management_api_server/operations/router}/update_transit_router_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/service/create_service.go (94%) rename {rest_server => rest_management_api_server}/operations/service/create_service_parameters.go (91%) rename {rest_server => rest_management_api_server}/operations/service/create_service_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/create_service_urlbuilder.go (98%) create mode 100644 rest_management_api_server/operations/service/delete_service.go create mode 100644 rest_management_api_server/operations/service/delete_service_parameters.go create mode 100644 rest_management_api_server/operations/service/delete_service_responses.go create mode 100644 rest_management_api_server/operations/service/delete_service_urlbuilder.go create mode 100644 rest_management_api_server/operations/service/detail_service.go create mode 100644 rest_management_api_server/operations/service/detail_service_parameters.go create mode 100644 rest_management_api_server/operations/service/detail_service_responses.go create mode 100644 rest_management_api_server/operations/service/detail_service_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/service/list_service_config.go (94%) rename {rest_server => rest_management_api_server}/operations/service/list_service_config_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service/list_service_config_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/list_service_config_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service/list_service_edge_routers.go (93%) rename {rest_server => rest_management_api_server}/operations/service/list_service_edge_routers_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service/list_service_edge_routers_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/list_service_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service/list_service_identities.go (93%) rename {rest_server => rest_management_api_server}/operations/service/list_service_identities_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service/list_service_identities_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/list_service_identities_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_edge_router_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service/list_service_service_policies_urlbuilder.go (99%) create mode 100644 rest_management_api_server/operations/service/list_service_terminators.go create mode 100644 rest_management_api_server/operations/service/list_service_terminators_parameters.go rename {rest_server => rest_management_api_server}/operations/service/list_service_terminators_responses.go (100%) create mode 100644 rest_management_api_server/operations/service/list_service_terminators_urlbuilder.go create mode 100644 rest_management_api_server/operations/service/list_services.go create mode 100644 rest_management_api_server/operations/service/list_services_parameters.go create mode 100644 rest_management_api_server/operations/service/list_services_responses.go create mode 100644 rest_management_api_server/operations/service/list_services_urlbuilder.go create mode 100644 rest_management_api_server/operations/service/patch_service.go create mode 100644 rest_management_api_server/operations/service/patch_service_parameters.go create mode 100644 rest_management_api_server/operations/service/patch_service_responses.go create mode 100644 rest_management_api_server/operations/service/patch_service_urlbuilder.go create mode 100644 rest_management_api_server/operations/service/update_service.go create mode 100644 rest_management_api_server/operations/service/update_service_parameters.go create mode 100644 rest_management_api_server/operations/service/update_service_responses.go create mode 100644 rest_management_api_server/operations/service/update_service_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/create_service_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/delete_service_edge_router_policy.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/detail_service_edge_router_policy.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_services.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/patch_service_edge_router_policy.go (92%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/update_service_edge_router_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/create_service_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/create_service_policy_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/service_policy/create_service_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/create_service_policy_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/delete_service_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/delete_service_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/delete_service_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/delete_service_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/detail_service_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/detail_service_policy_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/detail_service_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/detail_service_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policies.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policies_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policies_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policies_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_identities.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_identities_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_identities_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_identities_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_posture_checks.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_posture_checks_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_posture_checks_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_services.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_services_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_services_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/list_service_policy_services_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/service_policy/patch_service_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/patch_service_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/patch_service_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/patch_service_policy_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/service_policy/update_service_policy.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/update_service_policy_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/service_policy/update_service_policy_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/service_policy/update_service_policy_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/session/delete_session.go (94%) create mode 100644 rest_management_api_server/operations/session/delete_session_parameters.go create mode 100644 rest_management_api_server/operations/session/delete_session_responses.go create mode 100644 rest_management_api_server/operations/session/delete_session_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/session/detail_session.go (94%) create mode 100644 rest_management_api_server/operations/session/detail_session_parameters.go create mode 100644 rest_management_api_server/operations/session/detail_session_responses.go rename {rest_server => rest_management_api_server}/operations/session/detail_session_route_path.go (93%) rename {rest_server => rest_management_api_server}/operations/session/detail_session_route_path_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/session/detail_session_route_path_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/session/detail_session_route_path_urlbuilder.go (99%) create mode 100644 rest_management_api_server/operations/session/detail_session_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/session/list_sessions.go (94%) create mode 100644 rest_management_api_server/operations/session/list_sessions_parameters.go create mode 100644 rest_management_api_server/operations/session/list_sessions_responses.go create mode 100644 rest_management_api_server/operations/session/list_sessions_urlbuilder.go rename {rest_server => rest_management_api_server}/operations/terminator/create_terminator.go (94%) rename {rest_server => rest_management_api_server}/operations/terminator/create_terminator_parameters.go (92%) rename {rest_server => rest_management_api_server}/operations/terminator/create_terminator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/create_terminator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/delete_terminator.go (93%) rename {rest_server => rest_management_api_server}/operations/terminator/delete_terminator_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/delete_terminator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/delete_terminator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/detail_terminator.go (94%) rename {rest_server => rest_management_api_server}/operations/terminator/detail_terminator_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/detail_terminator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/detail_terminator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/list_terminators.go (94%) rename {rest_server => rest_management_api_server}/operations/terminator/list_terminators_parameters.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/list_terminators_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/list_terminators_urlbuilder.go (99%) rename {rest_server => rest_management_api_server}/operations/terminator/patch_terminator.go (94%) rename {rest_server => rest_management_api_server}/operations/terminator/patch_terminator_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/terminator/patch_terminator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/patch_terminator_urlbuilder.go (98%) rename {rest_server => rest_management_api_server}/operations/terminator/update_terminator.go (94%) rename {rest_server => rest_management_api_server}/operations/terminator/update_terminator_parameters.go (93%) rename {rest_server => rest_management_api_server}/operations/terminator/update_terminator_responses.go (100%) rename {rest_server => rest_management_api_server}/operations/terminator/update_terminator_urlbuilder.go (98%) rename rest_server/operations/ziti_edge_api.go => rest_management_api_server/operations/ziti_edge_management_api.go (83%) create mode 100644 rest_management_api_server/server.go delete mode 100644 rest_model/detail_geo_region_envelope.go rename rest_model/{detail_transit_router_envelope.go => detail_router_envelope.go} (59%) rename rest_model/{failed_session_request.go => failed_service_request.go} (64%) rename rest_model/{get_identity_failed_service_request_envelope.go => failed_service_request_envelope.go} (58%) delete mode 100644 rest_model/geo_region_detail.go rename rest_model/{list_geo_regions_envelope.go => list_client_terminators_envelope.go} (57%) rename rest_model/{list_transit_routers_envelope.go => list_routers_envelope.go} (59%) delete mode 100644 rest_model/mfa_created_envelope.go rename rest_model/{get_identity_posture_data_envelope.go => posture_data_envelope.go} (60%) rename rest_model/{transit_router_create.go => router_create.go} (64%) rename rest_model/{transit_router_detail.go => router_detail.go} (82%) rename rest_model/{geo_region_list.go => router_list.go} (70%) rename rest_model/{transit_router_patch.go => router_patch.go} (63%) rename rest_model/{transit_router_update.go => router_update.go} (64%) rename rest_model/{terminator_detail_limited.go => terminator_client_detail.go} (71%) rename rest_model/{transit_router_list.go => terminator_client_list.go} (67%) delete mode 100644 rest_server/operations/geo_region/detail_geo_region_parameters.go delete mode 100644 rest_server/operations/geo_region/detail_geo_region_responses.go delete mode 100644 rest_server/operations/geo_region/detail_geo_region_urlbuilder.go delete mode 100644 rest_server/operations/geo_region/list_geo_regions.go create mode 100644 specs/client.yml create mode 100644 specs/management.yml create mode 100644 specs/source/client.yml create mode 100644 specs/source/client/current-api-session-certificates.yml create mode 100644 specs/source/client/current-api-session-service-updates.yml create mode 100644 specs/source/client/current-identity-edge-routers.yml create mode 100644 specs/source/client/enroll.yml create mode 100644 specs/source/client/posture-response.yml create mode 100644 specs/source/client/protocols.yml create mode 100644 specs/source/client/services.yml create mode 100644 specs/source/client/sessions.yml create mode 100644 specs/source/client/well-known.yml create mode 100644 specs/source/management.yml create mode 100644 specs/source/management/api-sessions.yml create mode 100644 specs/source/management/authenticators.yml create mode 100644 specs/source/management/cas.yml create mode 100644 specs/source/management/config-types.yml create mode 100644 specs/source/management/configs.yml create mode 100644 specs/source/management/database.yml create mode 100644 specs/source/management/edge-router-policies.yml create mode 100644 specs/source/management/edge-routers.yml create mode 100644 specs/source/management/enrollments.yml create mode 100644 specs/source/management/failed-service-request.yml create mode 100644 specs/source/management/identities.yml create mode 100644 specs/source/management/identity-types.yml create mode 100644 specs/source/management/posture-check-types.yml create mode 100644 specs/source/management/posture-checks.yml create mode 100644 specs/source/management/posture-data.yml create mode 100644 specs/source/management/role-attributes.yml create mode 100644 specs/source/management/routers.yml create mode 100644 specs/source/management/service-configs.yml create mode 100644 specs/source/management/service-edge-router-policies.yml create mode 100644 specs/source/management/service-policies.yml create mode 100644 specs/source/management/services.yml create mode 100644 specs/source/management/sessions.yml create mode 100644 specs/source/management/summary.yml create mode 100644 specs/source/management/terminators.yml create mode 100644 specs/source/shared/api-sessions.yml create mode 100644 specs/source/shared/auth-query.yml create mode 100644 specs/source/shared/authenticate.yml create mode 100644 specs/source/shared/authenticators.yml create mode 100644 specs/source/shared/base-entity.yml create mode 100644 specs/source/shared/config-types.yml create mode 100644 specs/source/shared/current-api-session.yml create mode 100644 specs/source/shared/current-identity-authenticators.yml create mode 100644 specs/source/shared/current-identity-mfa.yml create mode 100644 specs/source/shared/current-identity.yml create mode 100644 specs/source/shared/edge-routers.yml create mode 100644 specs/source/shared/identities.yml create mode 100644 specs/source/shared/parameters.yml create mode 100644 specs/source/shared/posture-checks.yml create mode 100644 specs/source/shared/posture-queries.yml create mode 100644 specs/source/shared/services.yml create mode 100644 specs/source/shared/sessions.yml create mode 100644 specs/source/shared/specs.yml create mode 100644 specs/source/shared/standard-request.yml create mode 100644 specs/source/shared/standard-responses.yml create mode 100644 specs/source/shared/terminators.yml create mode 100644 specs/source/shared/version.yml diff --git a/controller/apierror/api.go b/controller/apierror/api.go index 4244a86df..3563f82ad 100644 --- a/controller/apierror/api.go +++ b/controller/apierror/api.go @@ -34,6 +34,14 @@ func ToRestModel(e *errorz.ApiError, requestId string) *rest_model.APIError { } if e.Cause != nil { + + //unwrap first error in composite error + compositeErr, ok := e.Cause.(*errors.CompositeError) + for ok { + e.Cause = compositeErr.Errors[0] + compositeErr, ok = e.Cause.(*errors.CompositeError) + } + if causeApiError, ok := e.Cause.(*errorz.ApiError); ok { //standard apierror ret.Cause = &rest_model.APIErrorCause{ @@ -72,6 +80,9 @@ func ToRestModel(e *errorz.ApiError, requestId string) *rest_model.APIError { Value: fmt.Sprintf("%v", causeFieldErr.Value), }, } + ret.Code = errorz.CouldNotValidateCode + ret.Message = errorz.CouldNotValidateMessage + } else if genericErr, ok := e.Cause.(GenericCauseError); ok { ret.Cause = &rest_model.APIErrorCause{ APIError: rest_model.APIError{ diff --git a/controller/env/appenv.go b/controller/env/appenv.go index 4c97187ca..9d1bbcb1a 100644 --- a/controller/env/appenv.go +++ b/controller/env/appenv.go @@ -39,8 +39,10 @@ import ( "github.com/openziti/edge/events" "github.com/openziti/edge/internal/cert" "github.com/openziti/edge/internal/jwt" - "github.com/openziti/edge/rest_server" - "github.com/openziti/edge/rest_server/operations" + 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/network" "github.com/openziti/fabric/controller/xctrl" "github.com/openziti/fabric/controller/xmgmt" @@ -73,7 +75,8 @@ type AppEnv struct { EnrollRegistry model.EnrollmentRegistry Broker *Broker HostController HostController - Api *operations.ZitiEdgeAPI + ManagementApi *managementOperations.ZitiEdgeManagementAPI + ClientApi *clientOperations.ZitiEdgeClientAPI IdentityRefreshMap cmap.ConcurrentMap StartupTime time.Time InstanceId string @@ -276,13 +279,21 @@ func (ae *AppEnv) FillRequestContext(rc *response.RequestContext) error { } func NewAppEnv(c *edgeConfig.Config) *AppEnv { - swaggerSpec, err := loads.Embedded(rest_server.SwaggerJSON, rest_server.FlatSwaggerJSON) + clientSpec, err := loads.Embedded(clientServer.SwaggerJSON, clientServer.FlatSwaggerJSON) if err != nil { pfxlog.Logger().Fatalln(err) } - api := operations.NewZitiEdgeAPI(swaggerSpec) - api.ServeError = ServeError + managementSpec, err := loads.Embedded(managementServer.SwaggerJSON, managementServer.FlatSwaggerJSON) + if err != nil { + pfxlog.Logger().Fatalln(err) + } + + clientApi := clientOperations.NewZitiEdgeClientAPI(clientSpec) + clientApi.ServeError = ServeError + + managementApi := managementOperations.NewZitiEdgeManagementAPI(managementSpec) + managementApi.ServeError = ServeError ae := &AppEnv{ Config: c, @@ -293,23 +304,25 @@ func NewAppEnv(c *edgeConfig.Config) *AppEnv { InstanceId: cuid.New(), AuthRegistry: &model.AuthProcessorRegistryImpl{}, EnrollRegistry: &model.EnrollmentRegistryImpl{}, - Api: api, + ManagementApi: managementApi, + ClientApi: clientApi, IdentityRefreshMap: cmap.New(), StartupTime: time.Now().UTC(), } - api.APIAuthorizer = authorizer{} + clientApi.APIAuthorizer = authorizer{} + managementApi.APIAuthorizer = authorizer{} noOpConsumer := runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error { return nil //do nothing }) //enrollment consumer, leave content unread, allow modules to read - api.ApplicationXPemFileConsumer = noOpConsumer - api.ApplicationPkcs10Consumer = noOpConsumer - api.ApplicationXPemFileProducer = &PemProducer{} - api.TextYamlProducer = &YamlProducer{} - api.ZtSessionAuth = func(token string) (principal interface{}, err error) { + clientApi.ApplicationXPemFileConsumer = noOpConsumer + clientApi.ApplicationPkcs10Consumer = noOpConsumer + clientApi.ApplicationXPemFileProducer = &PemProducer{} + clientApi.TextYamlProducer = &YamlProducer{} + clientApi.ZtSessionAuth = func(token string) (principal interface{}, err error) { principal, err = ae.GetHandlers().ApiSession.ReadByToken(token) if err != nil { @@ -323,6 +336,9 @@ func NewAppEnv(c *edgeConfig.Config) *AppEnv { return principal, nil } + managementApi.TextYamlProducer = &YamlProducer{} + managementApi.ZtSessionAuth = clientApi.ZtSessionAuth + sm := getJwtSigningMethod(c.Api.Identity.ServerCert()) key := c.Api.Identity.ServerCert().PrivateKey @@ -421,7 +437,7 @@ func (ae *AppEnv) CreateRequestContext(rw http.ResponseWriter, r *http.Request) return requestContext } -//use own type to avoid collisions +// ContextKey is used a custom type to avoid accidental context key collisions type ContextKey string const EdgeContextKey = ContextKey("edgeContext") @@ -478,4 +494,4 @@ func (ae *AppEnv) HandleServiceEvent(event *persistence.ServiceEvent) { func (ae *AppEnv) HandleServiceUpdatedEventForIdentityId(identityId string) { ae.IdentityRefreshMap.Set(identityId, time.Now().UTC()) -} \ No newline at end of file +} diff --git a/controller/internal/routes/api_session_api_model.go b/controller/internal/routes/api_session_api_model.go index b59c94b0b..53f619af2 100644 --- a/controller/internal/routes/api_session_api_model.go +++ b/controller/internal/routes/api_session_api_model.go @@ -112,6 +112,7 @@ func MapApiSessionToRestModel(ae *env.AppEnv, apiSession *model.ApiSession) (*re } func newAuthCheckZitiMfa() *rest_model.AuthQueryDetail { + provider := rest_model.MfaProvidersZiti return &rest_model.AuthQueryDetail{ TypeID: "MFA", Format: rest_model.MfaFormatsAlphaNumeric, @@ -119,6 +120,6 @@ func newAuthCheckZitiMfa() *rest_model.AuthQueryDetail { HTTPURL: "./authenticate/mfa", MaxLength: model.TotpMaxLength, MinLength: model.TotpMinLength, - Provider: rest_model.MfaProvidersZiti, + Provider: &provider, } } diff --git a/controller/internal/routes/api_session_router.go b/controller/internal/routes/api_session_router.go index 5581f17af..26f2a6258 100644 --- a/controller/internal/routes/api_session_router.go +++ b/controller/internal/routes/api_session_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/api_session" + "github.com/openziti/edge/rest_management_api_server/operations/api_session" ) func init() { @@ -40,15 +40,15 @@ func NewApiSessionRouter() *ApiSessionHandler { } func (ir *ApiSessionHandler) Register(ae *env.AppEnv) { - ae.Api.APISessionDeleteAPISessionsHandler = api_session.DeleteAPISessionsHandlerFunc(func(params api_session.DeleteAPISessionsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.APISessionDeleteAPISessionsHandler = api_session.DeleteAPISessionsHandlerFunc(func(params api_session.DeleteAPISessionsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(ir.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.APISessionDetailAPISessionsHandler = api_session.DetailAPISessionsHandlerFunc(func(params api_session.DetailAPISessionsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.APISessionDetailAPISessionsHandler = api_session.DetailAPISessionsHandlerFunc(func(params api_session.DetailAPISessionsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(ir.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.APISessionListAPISessionsHandler = api_session.ListAPISessionsHandlerFunc(func(params api_session.ListAPISessionsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.APISessionListAPISessionsHandler = api_session.ListAPISessionsHandlerFunc(func(params api_session.ListAPISessionsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(ir.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) } @@ -63,4 +63,4 @@ func (ir *ApiSessionHandler) Detail(ae *env.AppEnv, rc *response.RequestContext) func (ir *ApiSessionHandler) Delete(ae *env.AppEnv, rc *response.RequestContext) { DeleteWithHandler(rc, ae.Handlers.ApiSession) -} \ No newline at end of file +} diff --git a/controller/internal/routes/authenticate_router.go b/controller/internal/routes/authenticate_router.go index 9ea36bac0..f91f752b7 100644 --- a/controller/internal/routes/authenticate_router.go +++ b/controller/internal/routes/authenticate_router.go @@ -26,8 +26,9 @@ import ( "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/edge/rest_server/operations/authentication" "github.com/openziti/foundation/common/constants" "github.com/openziti/foundation/metrics" "github.com/openziti/foundation/util/errorz" @@ -51,19 +52,27 @@ func NewAuthRouter() *AuthRouter { func (ro *AuthRouter) Register(ae *env.AppEnv) { ro.createTimer = ae.GetHostController().GetNetwork().GetMetricsRegistry().Timer("api-session.create") - ae.Api.AuthenticationAuthenticateHandler = authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authHandler(ae, rc, params) }, params.HTTPRequest, "", "", permissions.Always()) + ae.ClientApi.AuthenticationAuthenticateHandler = clientApiAuthentication.AuthenticateHandlerFunc(func(params clientApiAuthentication.AuthenticateParams) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authHandler(ae, rc, params.HTTPRequest, params.Method, params.Auth) }, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.AuthenticationAuthenticateMfaHandler = authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, i interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authMfa(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsPartiallyAuthenticated()) + ae.ClientApi.AuthenticationAuthenticateMfaHandler = clientApiAuthentication.AuthenticateMfaHandlerFunc(func(params clientApiAuthentication.AuthenticateMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authMfa(ae, rc, params.MfaAuth) }, params.HTTPRequest, "", "", permissions.IsPartiallyAuthenticated()) + }) + + ae.ManagementApi.AuthenticationAuthenticateHandler = managementApiAuthentication.AuthenticateHandlerFunc(func(params managementApiAuthentication.AuthenticateParams) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authHandler(ae, rc, params.HTTPRequest, params.Method, params.Auth) }, params.HTTPRequest, "", "", permissions.Always()) + }) + + ae.ManagementApi.AuthenticationAuthenticateMfaHandler = managementApiAuthentication.AuthenticateMfaHandlerFunc(func(params managementApiAuthentication.AuthenticateMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.authMfa(ae, rc, params.MfaAuth) }, params.HTTPRequest, "", "", permissions.IsPartiallyAuthenticated()) }) } -func (ro *AuthRouter) authHandler(ae *env.AppEnv, rc *response.RequestContext, params authentication.AuthenticateParams) { +func (ro *AuthRouter) authHandler(ae *env.AppEnv, rc *response.RequestContext, httpRequest *http.Request, method string, auth *rest_model.Authenticate) { start := time.Now() logger := pfxlog.Logger() - authContext := model.NewAuthContextHttp(params.HTTPRequest, params.Method, params.Auth) + authContext := model.NewAuthContextHttp(httpRequest, method, auth) identity, err := ae.Handlers.Authenticator.IsAuthorized(authContext) @@ -116,8 +125,8 @@ func (ro *AuthRouter) authHandler(ae *env.AppEnv, rc *response.RequestContext, p token := uuid.New().String() configTypes := map[string]struct{}{} - if params.Auth != nil { - configTypes = ae.Handlers.ConfigType.MapConfigTypeNamesToIds(params.Auth.ConfigTypes, identity.Id) + if auth != nil { + configTypes = ae.Handlers.ConfigType.MapConfigTypeNamesToIds(auth.ConfigTypes, identity.Id) } remoteIpStr := "" if remoteIp, _, err := net.SplitHostPort(rc.Request.RemoteAddr); err == nil { @@ -162,7 +171,7 @@ func (ro *AuthRouter) authHandler(ae *env.AppEnv, rc *response.RequestContext, p apiSession := MapToCurrentApiSessionRestModel(ae, filledApiSession, ae.Config.SessionTimeoutDuration()) rc.ApiSession = filledApiSession - //re-calc session headers as they were not set wwhen ApiSession == NIL + //re-calc session headers as they were not set when ApiSession == NIL response.AddSessionHeaders(rc) envelope := &rest_model.CurrentAPISessionDetailEnvelope{Data: apiSession, Meta: &rest_model.Meta{}} @@ -174,7 +183,7 @@ func (ro *AuthRouter) authHandler(ae *env.AppEnv, rc *response.RequestContext, p rc.Respond(envelope, http.StatusOK) } -func (ro *AuthRouter) authMfa(ae *env.AppEnv, rc *response.RequestContext, params authentication.AuthenticateMfaParams) { +func (ro *AuthRouter) authMfa(ae *env.AppEnv, rc *response.RequestContext, mfaCode *rest_model.MfaCode) { mfa, err := ae.Handlers.Mfa.ReadByIdentityId(rc.Identity.Id) if err != nil { @@ -187,7 +196,7 @@ func (ro *AuthRouter) authMfa(ae *env.AppEnv, rc *response.RequestContext, param return } - ok, _ := ae.Handlers.Mfa.Verify(mfa, *params.MfaAuth.Code) + ok, _ := ae.Handlers.Mfa.Verify(mfa, *mfaCode.Code) if !ok { rc.RespondWithError(apierror.NewInvalidMfaTokenError()) diff --git a/controller/internal/routes/authenticator_api_model.go b/controller/internal/routes/authenticator_api_model.go index b14e5d060..cbaecde3a 100644 --- a/controller/internal/routes/authenticator_api_model.go +++ b/controller/internal/routes/authenticator_api_model.go @@ -85,8 +85,8 @@ func MapUpdateAuthenticatorToModel(id string, in *rest_model.AuthenticatorUpdate result.SubType = &model.AuthenticatorUpdb{ Authenticator: result, - Username: string(in.Username), - Password: string(in.Password), + Username: string(*in.Username), + Password: string(*in.Password), Salt: "", } diff --git a/controller/internal/routes/authenticator_router.go b/controller/internal/routes/authenticator_router.go index af63eaa68..e319fddf7 100644 --- a/controller/internal/routes/authenticator_router.go +++ b/controller/internal/routes/authenticator_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/authenticator" + "github.com/openziti/edge/rest_management_api_server/operations/authenticator" ) func init() { @@ -40,27 +40,27 @@ func NewAuthenticatorRouter() *AuthenticatorRouter { } func (r *AuthenticatorRouter) Register(ae *env.AppEnv) { - ae.Api.AuthenticatorDeleteAuthenticatorHandler = authenticator.DeleteAuthenticatorHandlerFunc(func(params authenticator.DeleteAuthenticatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorDeleteAuthenticatorHandler = authenticator.DeleteAuthenticatorHandlerFunc(func(params authenticator.DeleteAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.AuthenticatorDetailAuthenticatorHandler = authenticator.DetailAuthenticatorHandlerFunc(func(params authenticator.DetailAuthenticatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorDetailAuthenticatorHandler = authenticator.DetailAuthenticatorHandlerFunc(func(params authenticator.DetailAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.AuthenticatorListAuthenticatorsHandler = authenticator.ListAuthenticatorsHandlerFunc(func(params authenticator.ListAuthenticatorsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorListAuthenticatorsHandler = authenticator.ListAuthenticatorsHandlerFunc(func(params authenticator.ListAuthenticatorsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.AuthenticatorUpdateAuthenticatorHandler = authenticator.UpdateAuthenticatorHandlerFunc(func(params authenticator.UpdateAuthenticatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorUpdateAuthenticatorHandler = authenticator.UpdateAuthenticatorHandlerFunc(func(params authenticator.UpdateAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.AuthenticatorCreateAuthenticatorHandler = authenticator.CreateAuthenticatorHandlerFunc(func(params authenticator.CreateAuthenticatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorCreateAuthenticatorHandler = authenticator.CreateAuthenticatorHandlerFunc(func(params authenticator.CreateAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.AuthenticatorPatchAuthenticatorHandler = authenticator.PatchAuthenticatorHandlerFunc(func(params authenticator.PatchAuthenticatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.AuthenticatorPatchAuthenticatorHandler = authenticator.PatchAuthenticatorHandlerFunc(func(params authenticator.PatchAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/ca_router.go b/controller/internal/routes/ca_router.go index e66cce4fb..9801d4ab3 100644 --- a/controller/internal/routes/ca_router.go +++ b/controller/internal/routes/ca_router.go @@ -27,7 +27,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/certificate_authority" + "github.com/openziti/edge/rest_management_api_server/operations/certificate_authority" "github.com/openziti/foundation/storage/boltz" "github.com/openziti/sdk-golang/ziti/config" "github.com/pkg/errors" @@ -50,37 +50,37 @@ func NewCaRouter() *CaRouter { } func (r *CaRouter) Register(ae *env.AppEnv) { - ae.Api.CertificateAuthorityDeleteCaHandler = certificate_authority.DeleteCaHandlerFunc(func(params certificate_authority.DeleteCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityDeleteCaHandler = certificate_authority.DeleteCaHandlerFunc(func(params certificate_authority.DeleteCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityDetailCaHandler = certificate_authority.DetailCaHandlerFunc(func(params certificate_authority.DetailCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityDetailCaHandler = certificate_authority.DetailCaHandlerFunc(func(params certificate_authority.DetailCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityListCasHandler = certificate_authority.ListCasHandlerFunc(func(params certificate_authority.ListCasParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityListCasHandler = certificate_authority.ListCasHandlerFunc(func(params certificate_authority.ListCasParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityUpdateCaHandler = certificate_authority.UpdateCaHandlerFunc(func(params certificate_authority.UpdateCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityUpdateCaHandler = certificate_authority.UpdateCaHandlerFunc(func(params certificate_authority.UpdateCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityCreateCaHandler = certificate_authority.CreateCaHandlerFunc(func(params certificate_authority.CreateCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityCreateCaHandler = certificate_authority.CreateCaHandlerFunc(func(params certificate_authority.CreateCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityPatchCaHandler = certificate_authority.PatchCaHandlerFunc(func(params certificate_authority.PatchCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityPatchCaHandler = certificate_authority.PatchCaHandlerFunc(func(params certificate_authority.PatchCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityVerifyCaHandler = certificate_authority.VerifyCaHandlerFunc(func(params certificate_authority.VerifyCaParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityVerifyCaHandler = certificate_authority.VerifyCaHandlerFunc(func(params certificate_authority.VerifyCaParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.VerifyCert(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.CertificateAuthorityGetCaJwtHandler = certificate_authority.GetCaJwtHandlerFunc(func(params certificate_authority.GetCaJwtParams, _ interface{}) middleware.Responder { + ae.ManagementApi.CertificateAuthorityGetCaJwtHandler = certificate_authority.GetCaJwtHandlerFunc(func(params certificate_authority.GetCaJwtParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.generateJwt(ae, rc) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) diff --git a/controller/internal/routes/config_router.go b/controller/internal/routes/config_router.go index 1ac7133e5..dec58b558 100644 --- a/controller/internal/routes/config_router.go +++ b/controller/internal/routes/config_router.go @@ -22,7 +22,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/config" + "github.com/openziti/edge/rest_management_api_server/operations/config" ) func init() { @@ -41,27 +41,27 @@ func NewConfigRouter() *ConfigRouter { } func (r *ConfigRouter) Register(ae *env.AppEnv) { - ae.Api.ConfigDeleteConfigHandler = config.DeleteConfigHandlerFunc(func(params config.DeleteConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigDeleteConfigHandler = config.DeleteConfigHandlerFunc(func(params config.DeleteConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigDetailConfigHandler = config.DetailConfigHandlerFunc(func(params config.DetailConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigDetailConfigHandler = config.DetailConfigHandlerFunc(func(params config.DetailConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigListConfigsHandler = config.ListConfigsHandlerFunc(func(params config.ListConfigsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigListConfigsHandler = config.ListConfigsHandlerFunc(func(params config.ListConfigsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ConfigUpdateConfigHandler = config.UpdateConfigHandlerFunc(func(params config.UpdateConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigUpdateConfigHandler = config.UpdateConfigHandlerFunc(func(params config.UpdateConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigCreateConfigHandler = config.CreateConfigHandlerFunc(func(params config.CreateConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigCreateConfigHandler = config.CreateConfigHandlerFunc(func(params config.CreateConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ConfigPatchConfigHandler = config.PatchConfigHandlerFunc(func(params config.PatchConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigPatchConfigHandler = config.PatchConfigHandlerFunc(func(params config.PatchConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } @@ -77,7 +77,7 @@ func (r *ConfigRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { func (r *ConfigRouter) Create(ae *env.AppEnv, rc *response.RequestContext, params config.CreateConfigParams) { if params.Config.Data == nil { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("data", "body", nil)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("data", "body", nil)) return } @@ -93,7 +93,7 @@ func (r *ConfigRouter) Delete(ae *env.AppEnv, rc *response.RequestContext) { func (r *ConfigRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params config.UpdateConfigParams) { if params.Config.Data == nil { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("data", "body", nil)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("data", "body", nil)) return } diff --git a/controller/internal/routes/config_type_router.go b/controller/internal/routes/config_type_router.go index f18c9e9d8..16b45885d 100644 --- a/controller/internal/routes/config_type_router.go +++ b/controller/internal/routes/config_type_router.go @@ -22,7 +22,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/config" + "github.com/openziti/edge/rest_management_api_server/operations/config" ) func init() { @@ -41,31 +41,31 @@ func NewConfigTypeRouter() *ConfigTypeRouter { } func (r *ConfigTypeRouter) Register(ae *env.AppEnv) { - ae.Api.ConfigDeleteConfigTypeHandler = config.DeleteConfigTypeHandlerFunc(func(params config.DeleteConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigDeleteConfigTypeHandler = config.DeleteConfigTypeHandlerFunc(func(params config.DeleteConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigDetailConfigTypeHandler = config.DetailConfigTypeHandlerFunc(func(params config.DetailConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigDetailConfigTypeHandler = config.DetailConfigTypeHandlerFunc(func(params config.DetailConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigListConfigTypesHandler = config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigListConfigTypesHandler = config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ConfigUpdateConfigTypeHandler = config.UpdateConfigTypeHandlerFunc(func(params config.UpdateConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigUpdateConfigTypeHandler = config.UpdateConfigTypeHandlerFunc(func(params config.UpdateConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigCreateConfigTypeHandler = config.CreateConfigTypeHandlerFunc(func(params config.CreateConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigCreateConfigTypeHandler = config.CreateConfigTypeHandlerFunc(func(params config.CreateConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ConfigPatchConfigTypeHandler = config.PatchConfigTypeHandlerFunc(func(params config.PatchConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigPatchConfigTypeHandler = config.PatchConfigTypeHandlerFunc(func(params config.PatchConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ConfigListConfigsForConfigTypeHandler = config.ListConfigsForConfigTypeHandlerFunc(func(params config.ListConfigsForConfigTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ConfigListConfigsForConfigTypeHandler = config.ListConfigsForConfigTypeHandlerFunc(func(params config.ListConfigsForConfigTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.ListConfigs(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) } @@ -82,7 +82,7 @@ func (r *ConfigTypeRouter) Create(ae *env.AppEnv, rc *response.RequestContext, p if params.ConfigType.Schema != nil { if _, ok := params.ConfigType.Schema.(map[string]interface{}); !ok { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) return } } @@ -100,7 +100,7 @@ func (r *ConfigTypeRouter) Update(ae *env.AppEnv, rc *response.RequestContext, p if params.ConfigType.Schema != nil { if _, ok := params.ConfigType.Schema.(map[string]interface{}); !ok { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) return } } @@ -114,12 +114,12 @@ func (r *ConfigTypeRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, pa if _, ok := params.ConfigType.Schema.(map[string]interface{}); !ok { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.InvalidType("schema", "body", "object", params.ConfigType.Schema)) return } if params.ConfigType.Schema == nil { ctx := middleware.MatchedRouteFrom(rc.Request) - ae.Api.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("schema", "body", nil)) + ae.ManagementApi.ServeErrorFor(ctx.Operation.ID)(rc.ResponseWriter, rc.Request, errors.Required("schema", "body", nil)) return } diff --git a/controller/internal/routes/current_api_session_router.go b/controller/internal/routes/current_api_session_router.go index b260a8839..c0c08c589 100644 --- a/controller/internal/routes/current_api_session_router.go +++ b/controller/internal/routes/current_api_session_router.go @@ -22,8 +22,9 @@ import ( "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/edge/rest_server/operations/current_api_session" "net/http" "time" ) @@ -41,36 +42,46 @@ func NewCurrentSessionRouter() *CurrentSessionRouter { } func (router *CurrentSessionRouter) Register(ae *env.AppEnv) { - ae.Api.CurrentAPISessionGetCurrentAPISessionHandler = current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, i interface{}) middleware.Responder { + //Client + ae.ClientApi.CurrentAPISessionGetCurrentAPISessionHandler = clientCurrentApiSession.GetCurrentAPISessionHandlerFunc(func(params clientCurrentApiSession.GetCurrentAPISessionParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.Detail, params.HTTPRequest, "", "", permissions.HasOneOf(permissions.IsAuthenticated(), permissions.IsPartiallyAuthenticated())) }) - ae.Api.CurrentAPISessionDeleteCurrentAPISessionHandler = current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionDeleteCurrentAPISessionHandler = clientCurrentApiSession.DeleteCurrentAPISessionHandlerFunc(func(params clientCurrentApiSession.DeleteCurrentAPISessionParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.Delete, params.HTTPRequest, "", "", permissions.HasOneOf(permissions.IsAuthenticated(), permissions.IsPartiallyAuthenticated())) }) - ae.Api.CurrentAPISessionListCurrentAPISessionCertificatesHandler = current_api_session.ListCurrentAPISessionCertificatesHandlerFunc(func(params current_api_session.ListCurrentAPISessionCertificatesParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionListCurrentAPISessionCertificatesHandler = clientCurrentApiSession.ListCurrentAPISessionCertificatesHandlerFunc(func(params clientCurrentApiSession.ListCurrentAPISessionCertificatesParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.ListCertificates, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionCreateCurrentAPISessionCertificateHandler = current_api_session.CreateCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.CreateCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionCreateCurrentAPISessionCertificateHandler = clientCurrentApiSession.CreateCurrentAPISessionCertificateHandlerFunc(func(params clientCurrentApiSession.CreateCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { router.CreateCertificate(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionDetailCurrentAPISessionCertificateHandler = current_api_session.DetailCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DetailCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionDetailCurrentAPISessionCertificateHandler = clientCurrentApiSession.DetailCurrentAPISessionCertificateHandlerFunc(func(params clientCurrentApiSession.DetailCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.DetailCertificate, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler = current_api_session.DeleteCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler = clientCurrentApiSession.DeleteCurrentAPISessionCertificateHandlerFunc(func(params clientCurrentApiSession.DeleteCurrentAPISessionCertificateParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.DeleteCertificate, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) // Session Updates - ae.Api.CurrentAPISessionListServiceUpdatesHandler = current_api_session.ListServiceUpdatesHandlerFunc(func(params current_api_session.ListServiceUpdatesParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionListServiceUpdatesHandler = clientCurrentApiSession.ListServiceUpdatesHandlerFunc(func(params clientCurrentApiSession.ListServiceUpdatesParams, i interface{}) middleware.Responder { return ae.IsAllowed(router.ListServiceUpdates, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) + + //Management + ae.ManagementApi.CurrentAPISessionGetCurrentAPISessionHandler = managementCurrentApiSession.GetCurrentAPISessionHandlerFunc(func(params managementCurrentApiSession.GetCurrentAPISessionParams, i interface{}) middleware.Responder { + return ae.IsAllowed(router.Detail, params.HTTPRequest, "", "", permissions.HasOneOf(permissions.IsAuthenticated(), permissions.IsPartiallyAuthenticated())) + }) + + ae.ManagementApi.CurrentAPISessionDeleteCurrentAPISessionHandler = managementCurrentApiSession.DeleteCurrentAPISessionHandlerFunc(func(params managementCurrentApiSession.DeleteCurrentAPISessionParams, i interface{}) middleware.Responder { + return ae.IsAllowed(router.Delete, params.HTTPRequest, "", "", permissions.HasOneOf(permissions.IsAuthenticated(), permissions.IsPartiallyAuthenticated())) + }) } func (router *CurrentSessionRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { @@ -110,7 +121,7 @@ func (router *CurrentSessionRouter) ListCertificates(ae *env.AppEnv, rc *respons }) } -func (router *CurrentSessionRouter) CreateCertificate(ae *env.AppEnv, rc *response.RequestContext, params current_api_session.CreateCurrentAPISessionCertificateParams) { +func (router *CurrentSessionRouter) CreateCertificate(ae *env.AppEnv, rc *response.RequestContext, params clientCurrentApiSession.CreateCurrentAPISessionCertificateParams) { responder := &ApiSessionCertificateCreateResponder{ae: ae, Responder: rc} CreateWithResponder(rc, responder, CurrentApiSessionCertificateLinkFactory, func() (string, error) { return ae.GetHandlers().ApiSessionCertificate.CreateFromCSR(rc.ApiSession.Id, 12*time.Hour, []byte(*params.SessionCertificate.Csr)) @@ -182,9 +193,9 @@ type ApiSessionCertificateCreateResponder struct { ae *env.AppEnv } -func (nsr *ApiSessionCertificateCreateResponder) RespondWithCreatedId(id string, link rest_model.Link) { +func (nsr *ApiSessionCertificateCreateResponder) RespondWithCreatedId(id string, _ rest_model.Link) { sessionCert, _ := nsr.ae.GetHandlers().ApiSessionCertificate.Read(id) - certString := string(sessionCert.PEM) + certString := sessionCert.PEM newSessionEnvelope := &rest_model.CreateCurrentAPISessionCertificateEnvelope{ Data: &rest_model.CurrentAPISessionCertificateCreateResponse{ diff --git a/controller/internal/routes/current_identity_authenticator_api_model.go b/controller/internal/routes/current_identity_authenticator_api_model.go index 02ba78446..b2fe52c14 100644 --- a/controller/internal/routes/current_identity_authenticator_api_model.go +++ b/controller/internal/routes/current_identity_authenticator_api_model.go @@ -51,7 +51,7 @@ func (factory *CurrentIdentityAuthenticatorLinkFactoryImpl) SelfLink(entity mode func (factory *CurrentIdentityAuthenticatorLinkFactoryImpl) Links(entity models.Entity) rest_model.Links { return rest_model.Links{ - EntityNameSelf: factory.SelfLink(entity), + EntityNameSelf: factory.SelfLink(entity), } } @@ -61,10 +61,10 @@ func MapUpdateAuthenticatorWithCurrentToModel(id, identityId string, authenticat Tags: authenticator.Tags, Id: id, }, - CurrentPassword: string(authenticator.CurrentPassword), - NewPassword: string(authenticator.Password), + CurrentPassword: string(*authenticator.CurrentPassword), + NewPassword: string(*authenticator.Password), IdentityId: identityId, - Username: string(authenticator.Username), + Username: string(*authenticator.Username), } return ret @@ -76,7 +76,7 @@ func MapPatchAuthenticatorWithCurrentToModel(id, identityId string, authenticato Tags: authenticator.Tags, Id: id, }, - CurrentPassword: string(authenticator.CurrentPassword), + CurrentPassword: string(*authenticator.CurrentPassword), IdentityId: identityId, } diff --git a/controller/internal/routes/current_identity_authenticator_router.go b/controller/internal/routes/current_identity_authenticator_router.go index 80c360687..ef4e0ce09 100644 --- a/controller/internal/routes/current_identity_authenticator_router.go +++ b/controller/internal/routes/current_identity_authenticator_router.go @@ -22,7 +22,9 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/current_api_session" + 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/storage/boltz" ) @@ -42,20 +44,40 @@ func NewCurrentIdentityAuthenticatorRouter() *CurrentIdentityAuthenticatorRouter } func (r *CurrentIdentityAuthenticatorRouter) Register(ae *env.AppEnv) { - ae.Api.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler = current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + //Client + + ae.ClientApi.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler = clientCurrentApiSession.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params clientCurrentApiSession.DetailCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler = current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, _ interface{}) middleware.Responder { + ae.ClientApi.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler = clientCurrentApiSession.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params clientCurrentApiSession.ListCurrentIdentityAuthenticatorsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler = current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + ae.ClientApi.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler = clientCurrentApiSession.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params clientCurrentApiSession.UpdateCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params.Authenticator) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) - ae.Api.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler = current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + ae.ClientApi.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler = clientCurrentApiSession.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params clientCurrentApiSession.PatchCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params.Authenticator) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + //Management + + ae.ManagementApi.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler = managementCurrentApiSession.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params managementCurrentApiSession.DetailCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler = managementCurrentApiSession.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params managementCurrentApiSession.ListCurrentIdentityAuthenticatorsParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler = managementCurrentApiSession.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params managementCurrentApiSession.UpdateCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params.Authenticator) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler = managementCurrentApiSession.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params managementCurrentApiSession.PatchCurrentIdentityAuthenticatorParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params.Authenticator) }, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) } @@ -107,14 +129,14 @@ func (r *CurrentIdentityAuthenticatorRouter) Detail(ae *env.AppEnv, rc *response }) } -func (r *CurrentIdentityAuthenticatorRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params current_api_session.UpdateCurrentIdentityAuthenticatorParams) { +func (r *CurrentIdentityAuthenticatorRouter) Update(ae *env.AppEnv, rc *response.RequestContext, authenticator *rest_model.AuthenticatorUpdateWithCurrent) { Update(rc, func(id string) error { - return ae.Handlers.Authenticator.UpdateSelf(MapUpdateAuthenticatorWithCurrentToModel(params.ID, rc.Identity.Id, params.Authenticator)) + return ae.Handlers.Authenticator.UpdateSelf(MapUpdateAuthenticatorWithCurrentToModel(id, rc.Identity.Id, authenticator)) }) } -func (r *CurrentIdentityAuthenticatorRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, params current_api_session.PatchCurrentIdentityAuthenticatorParams) { +func (r *CurrentIdentityAuthenticatorRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, authenticator *rest_model.AuthenticatorPatchWithCurrent) { Patch(rc, func(id string, fields JsonFields) error { - return ae.Handlers.Authenticator.PatchSelf(MapPatchAuthenticatorWithCurrentToModel(params.ID, rc.Identity.Id, params.Authenticator), fields.FilterMaps("tags")) + return ae.Handlers.Authenticator.PatchSelf(MapPatchAuthenticatorWithCurrentToModel(id, rc.Identity.Id, authenticator), fields.FilterMaps("tags")) }) } diff --git a/controller/internal/routes/current_identity_router.go b/controller/internal/routes/current_identity_router.go index 96b46c116..b9a3d7d86 100644 --- a/controller/internal/routes/current_identity_router.go +++ b/controller/internal/routes/current_identity_router.go @@ -24,8 +24,9 @@ import ( "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/edge/rest_server/operations/current_identity" "github.com/openziti/foundation/storage/boltz" "github.com/openziti/foundation/util/errorz" "github.com/pkg/errors" @@ -48,51 +49,93 @@ func NewCurrentIdentityRouter() *CurrentIdentityRouter { } func (r *CurrentIdentityRouter) Register(ae *env.AppEnv) { - ae.Api.CurrentIdentityGetCurrentIdentityHandler = current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, _ interface{}) middleware.Responder { + //Client + ae.ClientApi.CurrentIdentityGetCurrentIdentityHandler = clientCurrentIdentity.GetCurrentIdentityHandlerFunc(func(params clientCurrentIdentity.GetCurrentIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(detailCurrentUser, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityDeleteMfaHandler = current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityDeleteMfaHandler = clientCurrentIdentity.DeleteMfaHandlerFunc(func(params clientCurrentIdentity.DeleteMfaParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { - r.removeMfa(ae, rc, params) + r.removeMfa(ae, rc, params.MfaValidation, params.MfaValidationCode) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityDetailMfaHandler = current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityDetailMfaHandler = clientCurrentIdentity.DetailMfaHandlerFunc(func(params clientCurrentIdentity.DetailMfaParams, i interface{}) middleware.Responder { return ae.IsAllowed(r.detailMfa, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityEnrollMfaHandler = current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityEnrollMfaHandler = clientCurrentIdentity.EnrollMfaHandlerFunc(func(params clientCurrentIdentity.EnrollMfaParams, i interface{}) middleware.Responder { return ae.IsAllowed(r.createMfa, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityVerifyMfaHandler = current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityVerifyMfaHandler = clientCurrentIdentity.VerifyMfaHandlerFunc(func(params clientCurrentIdentity.VerifyMfaParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.verifyMfa(ae, rc, params.MfaValidation) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityDetailMfaQrCodeHandler = current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityDetailMfaQrCodeHandler = clientCurrentIdentity.DetailMfaQrCodeHandlerFunc(func(params clientCurrentIdentity.DetailMfaQrCodeParams, i interface{}) middleware.Responder { return ae.IsAllowed(r.detailMfaQrCode, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityCreateMfaRecoveryCodesHandler = current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityCreateMfaRecoveryCodesHandler = clientCurrentIdentity.CreateMfaRecoveryCodesHandlerFunc(func(params clientCurrentIdentity.CreateMfaRecoveryCodesParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.createMfaRecoveryCodes(ae, rc, params.MfaValidation) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityDetailMfaRecoveryCodesHandler = current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityDetailMfaRecoveryCodesHandler = clientCurrentIdentity.DetailMfaRecoveryCodesHandlerFunc(func(params clientCurrentIdentity.DetailMfaRecoveryCodesParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { - r.detailMfaRecoveryCodes(ae, rc, params) + r.detailMfaRecoveryCodes(ae, rc, params.MfaValidation, params.MfaValidationCode) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler = current_identity.GetCurrentIdentityEdgeRoutersHandlerFunc(func(params current_identity.GetCurrentIdentityEdgeRoutersParams, i interface{}) middleware.Responder { + ae.ClientApi.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler = clientCurrentIdentity.GetCurrentIdentityEdgeRoutersHandlerFunc(func(params clientCurrentIdentity.GetCurrentIdentityEdgeRoutersParams, i interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.listEdgeRouters(ae, rc) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) + + //Management + ae.ManagementApi.CurrentIdentityGetCurrentIdentityHandler = managementCurrentIdentity.GetCurrentIdentityHandlerFunc(func(params managementCurrentIdentity.GetCurrentIdentityParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(detailCurrentUser, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityDeleteMfaHandler = managementCurrentIdentity.DeleteMfaHandlerFunc(func(params managementCurrentIdentity.DeleteMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { + r.removeMfa(ae, rc, params.MfaValidation, params.MfaValidationCode) + }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityDetailMfaHandler = managementCurrentIdentity.DetailMfaHandlerFunc(func(params managementCurrentIdentity.DetailMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(r.detailMfa, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityEnrollMfaHandler = managementCurrentIdentity.EnrollMfaHandlerFunc(func(params managementCurrentIdentity.EnrollMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(r.createMfa, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityVerifyMfaHandler = managementCurrentIdentity.VerifyMfaHandlerFunc(func(params managementCurrentIdentity.VerifyMfaParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { + r.verifyMfa(ae, rc, params.MfaValidation) + }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityDetailMfaQrCodeHandler = managementCurrentIdentity.DetailMfaQrCodeHandlerFunc(func(params managementCurrentIdentity.DetailMfaQrCodeParams, i interface{}) middleware.Responder { + return ae.IsAllowed(r.detailMfaQrCode, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityCreateMfaRecoveryCodesHandler = managementCurrentIdentity.CreateMfaRecoveryCodesHandlerFunc(func(params managementCurrentIdentity.CreateMfaRecoveryCodesParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { + r.createMfaRecoveryCodes(ae, rc, params.MfaValidation) + }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ManagementApi.CurrentIdentityDetailMfaRecoveryCodesHandler = managementCurrentIdentity.DetailMfaRecoveryCodesHandlerFunc(func(params managementCurrentIdentity.DetailMfaRecoveryCodesParams, i interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { + r.detailMfaRecoveryCodes(ae, rc, params.MfaValidation, params.MfaValidationCode) + }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) } func (r *CurrentIdentityRouter) verifyMfa(ae *env.AppEnv, rc *response.RequestContext, body *rest_model.MfaCode) { @@ -187,13 +230,13 @@ func (r *CurrentIdentityRouter) detailMfa(ae *env.AppEnv, rc *response.RequestCo }) } -func (r *CurrentIdentityRouter) removeMfa(ae *env.AppEnv, rc *response.RequestContext, params current_identity.DeleteMfaParams) { +func (r *CurrentIdentityRouter) removeMfa(ae *env.AppEnv, rc *response.RequestContext, mfaValidationBody *rest_model.MfaCode, mfaCodeHeader *string) { code := "" - if params.MfaValidation != nil && params.MfaValidation.Code != nil { - code = *params.MfaValidation.Code - } else if params.MfaValidationCode != nil { - code = *params.MfaValidationCode + if mfaValidationBody != nil && mfaValidationBody.Code != nil { + code = *mfaValidationBody.Code + } else if mfaCodeHeader != nil { + code = *mfaCodeHeader } err := ae.Handlers.Mfa.DeleteForIdentity(rc.Identity, code) @@ -235,7 +278,7 @@ func (r *CurrentIdentityRouter) detailMfaQrCode(ae *env.AppEnv, rc *response.Req rc.ResponseWriter.Header().Set("content-type", "image/png") rc.ResponseWriter.WriteHeader(http.StatusOK) - rc.ResponseWriter.Write(png) + _, _ = rc.ResponseWriter.Write(png) } func (r *CurrentIdentityRouter) createMfaRecoveryCodes(ae *env.AppEnv, rc *response.RequestContext, body *rest_model.MfaCode) { @@ -271,7 +314,7 @@ func (r *CurrentIdentityRouter) createMfaRecoveryCodes(ae *env.AppEnv, rc *respo rc.RespondWithEmptyOk() } -func (r *CurrentIdentityRouter) detailMfaRecoveryCodes(ae *env.AppEnv, rc *response.RequestContext, params current_identity.DetailMfaRecoveryCodesParams) { +func (r *CurrentIdentityRouter) detailMfaRecoveryCodes(ae *env.AppEnv, rc *response.RequestContext, mfaValidationBody *rest_model.MfaCode, mfaCodeHeader *string) { mfa, err := ae.Handlers.Mfa.ReadByIdentityId(rc.Identity.Id) if err != nil { @@ -291,10 +334,10 @@ func (r *CurrentIdentityRouter) detailMfaRecoveryCodes(ae *env.AppEnv, rc *respo code := "" - if params.MfaValidation != nil && params.MfaValidation.Code != nil { - code = *params.MfaValidation.Code - } else if params.MfaValidationCode != nil { - code = *params.MfaValidationCode + if mfaValidationBody != nil && mfaValidationBody.Code != nil { + code = *mfaValidationBody.Code + } else if mfaCodeHeader != nil { + code = *mfaCodeHeader } if code == "" { diff --git a/controller/internal/routes/database_router.go b/controller/internal/routes/database_router.go index eda292354..f45273f38 100644 --- a/controller/internal/routes/database_router.go +++ b/controller/internal/routes/database_router.go @@ -25,8 +25,8 @@ import ( "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/edge/rest_server/operations/database" "github.com/openziti/fabric/controller/network" "github.com/openziti/foundation/util/concurrenz" "net/http" @@ -59,19 +59,19 @@ func NewDatabaseRouter() *DatabaseRouter { } func (r *DatabaseRouter) Register(ae *env.AppEnv) { - ae.Api.DatabaseCreateDatabaseSnapshotHandler = database.CreateDatabaseSnapshotHandlerFunc(func(params database.CreateDatabaseSnapshotParams, _ interface{}) middleware.Responder { + ae.ManagementApi.DatabaseCreateDatabaseSnapshotHandler = database.CreateDatabaseSnapshotHandlerFunc(func(params database.CreateDatabaseSnapshotParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.CreateSnapshot(ae, rc) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.DatabaseCheckDataIntegrityHandler = database.CheckDataIntegrityHandlerFunc(func(params database.CheckDataIntegrityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.DatabaseCheckDataIntegrityHandler = database.CheckDataIntegrityHandlerFunc(func(params database.CheckDataIntegrityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.CheckDatastoreIntegrity(ae, rc, false) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.DatabaseFixDataIntegrityHandler = database.FixDataIntegrityHandlerFunc(func(params database.FixDataIntegrityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.DatabaseFixDataIntegrityHandler = database.FixDataIntegrityHandlerFunc(func(params database.FixDataIntegrityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.CheckDatastoreIntegrity(ae, rc, true) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.DatabaseDataIntegrityResultsHandler = database.DataIntegrityResultsHandlerFunc(func(params database.DataIntegrityResultsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.DatabaseDataIntegrityResultsHandler = database.DataIntegrityResultsHandlerFunc(func(params database.DataIntegrityResultsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.GetCheckProgress(rc) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/edge_router_policy_api_model.go b/controller/internal/routes/edge_router_policy_api_model.go index 8994eae65..d6103325b 100644 --- a/controller/internal/routes/edge_router_policy_api_model.go +++ b/controller/internal/routes/edge_router_policy_api_model.go @@ -115,6 +115,7 @@ func MapEdgeRouterPolicyToRestEntity(ae *env.AppEnv, _ *response.RequestContext, } func MapEdgeRouterPolicyToRestModel(ae *env.AppEnv, policy *model.EdgeRouterPolicy) (*rest_model.EdgeRouterPolicyDetail, error) { + semantic := rest_model.Semantic(policy.Semantic) ret := &rest_model.EdgeRouterPolicyDetail{ BaseEntity: BaseEntityToRestModel(policy, EdgeRouterPolicyLinkFactory), EdgeRouterRoles: policy.EdgeRouterRoles, @@ -122,7 +123,7 @@ func MapEdgeRouterPolicyToRestModel(ae *env.AppEnv, policy *model.EdgeRouterPoli IdentityRoles: policy.IdentityRoles, IdentityRolesDisplay: GetNamedIdentityRoles(ae.GetHandlers().Identity, policy.IdentityRoles), Name: &policy.Name, - Semantic: rest_model.Semantic(policy.Semantic), + Semantic: &semantic, IsSystem: &policy.IsSystem, } diff --git a/controller/internal/routes/edge_router_policy_router.go b/controller/internal/routes/edge_router_policy_router.go index f8bd51222..62c628ddc 100644 --- a/controller/internal/routes/edge_router_policy_router.go +++ b/controller/internal/routes/edge_router_policy_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/edge_router_policy" + "github.com/openziti/edge/rest_management_api_server/operations/edge_router_policy" ) func init() { @@ -41,36 +41,36 @@ func NewEdgeRouterPolicyRouter() *EdgeRouterPolicyRouter { func (r *EdgeRouterPolicyRouter) Register(ae *env.AppEnv) { //CRUD - ae.Api.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler = edge_router_policy.DeleteEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DeleteEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler = edge_router_policy.DeleteEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DeleteEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyDetailEdgeRouterPolicyHandler = edge_router_policy.DetailEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DetailEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyDetailEdgeRouterPolicyHandler = edge_router_policy.DetailEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DetailEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyListEdgeRouterPoliciesHandler = edge_router_policy.ListEdgeRouterPoliciesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyListEdgeRouterPoliciesHandler = edge_router_policy.ListEdgeRouterPoliciesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler = edge_router_policy.UpdateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.UpdateEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler = edge_router_policy.UpdateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.UpdateEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyCreateEdgeRouterPolicyHandler = edge_router_policy.CreateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.CreateEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyCreateEdgeRouterPolicyHandler = edge_router_policy.CreateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.CreateEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyPatchEdgeRouterPolicyHandler = edge_router_policy.PatchEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.PatchEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyPatchEdgeRouterPolicyHandler = edge_router_policy.PatchEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.PatchEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) //Additional Lists - ae.Api.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler = edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyEdgeRoutersParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler = edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyEdgeRoutersParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListEdgeRouters, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler = edge_router_policy.ListEdgeRouterPolicyIdentitiesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyIdentitiesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler = edge_router_policy.ListEdgeRouterPolicyIdentitiesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyIdentitiesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListIdentities, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/edge_router_router.go b/controller/internal/routes/edge_router_router.go index dbd4ff076..7eacc91b6 100644 --- a/controller/internal/routes/edge_router_router.go +++ b/controller/internal/routes/edge_router_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/edge_router" + "github.com/openziti/edge/rest_management_api_server/operations/edge_router" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/storage/ast" ) @@ -43,44 +43,44 @@ func NewEdgeRouterRouter() *EdgeRouterRouter { func (r *EdgeRouterRouter) Register(ae *env.AppEnv) { //CRUD - ae.Api.EdgeRouterDeleteEdgeRouterHandler = edge_router.DeleteEdgeRouterHandlerFunc(func(params edge_router.DeleteEdgeRouterParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterDeleteEdgeRouterHandler = edge_router.DeleteEdgeRouterHandlerFunc(func(params edge_router.DeleteEdgeRouterParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterDetailEdgeRouterHandler = edge_router.DetailEdgeRouterHandlerFunc(func(params edge_router.DetailEdgeRouterParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterDetailEdgeRouterHandler = edge_router.DetailEdgeRouterHandlerFunc(func(params edge_router.DetailEdgeRouterParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterListEdgeRoutersHandler = edge_router.ListEdgeRoutersHandlerFunc(func(params edge_router.ListEdgeRoutersParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterListEdgeRoutersHandler = edge_router.ListEdgeRoutersHandlerFunc(func(params edge_router.ListEdgeRoutersParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterUpdateEdgeRouterHandler = edge_router.UpdateEdgeRouterHandlerFunc(func(params edge_router.UpdateEdgeRouterParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterUpdateEdgeRouterHandler = edge_router.UpdateEdgeRouterHandlerFunc(func(params edge_router.UpdateEdgeRouterParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterCreateEdgeRouterHandler = edge_router.CreateEdgeRouterHandlerFunc(func(params edge_router.CreateEdgeRouterParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterCreateEdgeRouterHandler = edge_router.CreateEdgeRouterHandlerFunc(func(params edge_router.CreateEdgeRouterParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterPatchEdgeRouterHandler = edge_router.PatchEdgeRouterHandlerFunc(func(params edge_router.PatchEdgeRouterParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterPatchEdgeRouterHandler = edge_router.PatchEdgeRouterHandlerFunc(func(params edge_router.PatchEdgeRouterParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // additional lists - ae.Api.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listEdgeRouterPolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServiceEdgeRouterPolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterListEdgeRouterIdentitiesHandler = edge_router.ListEdgeRouterIdentitiesHandlerFunc(func(params edge_router.ListEdgeRouterIdentitiesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterListEdgeRouterIdentitiesHandler = edge_router.ListEdgeRouterIdentitiesHandlerFunc(func(params edge_router.ListEdgeRouterIdentitiesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listIdentities, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EdgeRouterListEdgeRouterServicesHandler = edge_router.ListEdgeRouterServicesHandlerFunc(func(params edge_router.ListEdgeRouterServicesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EdgeRouterListEdgeRouterServicesHandler = edge_router.ListEdgeRouterServicesHandlerFunc(func(params edge_router.ListEdgeRouterServicesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServices, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/enroll_router.go b/controller/internal/routes/enroll_router.go index fe18fece3..bc742dceb 100644 --- a/controller/internal/routes/enroll_router.go +++ b/controller/internal/routes/enroll_router.go @@ -30,9 +30,9 @@ import ( "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/edge/rest_server/operations/enroll" - "github.com/openziti/edge/rest_server/operations/well_known" "github.com/openziti/foundation/util/errorz" "net/http" "strings" @@ -53,36 +53,35 @@ func NewEnrollRouter() *EnrollRouter { func (ro *EnrollRouter) Register(ae *env.AppEnv) { //Enroll - - ae.Api.EnrollEnrollHandler = enroll.EnrollHandlerFunc(func(params enroll.EnrollParams) middleware.Responder { + ae.ClientApi.EnrollEnrollHandler = enroll.EnrollHandlerFunc(func(params enroll.EnrollParams) middleware.Responder { return ae.IsAllowed(ro.enrollHandler, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.EnrollEnrollCaHandler = enroll.EnrollCaHandlerFunc(func(params enroll.EnrollCaParams) middleware.Responder { + ae.ClientApi.EnrollEnrollCaHandler = enroll.EnrollCaHandlerFunc(func(params enroll.EnrollCaParams) middleware.Responder { return ae.IsAllowed(ro.enrollHandler, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.EnrollEnrollOttCaHandler = enroll.EnrollOttCaHandlerFunc(func(params enroll.EnrollOttCaParams) middleware.Responder { + ae.ClientApi.EnrollEnrollOttCaHandler = enroll.EnrollOttCaHandlerFunc(func(params enroll.EnrollOttCaParams) middleware.Responder { return ae.IsAllowed(ro.enrollHandler, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.EnrollEnrollOttHandler = enroll.EnrollOttHandlerFunc(func(params enroll.EnrollOttParams) middleware.Responder { + ae.ClientApi.EnrollEnrollOttHandler = enroll.EnrollOttHandlerFunc(func(params enroll.EnrollOttParams) middleware.Responder { return ae.IsAllowed(ro.enrollHandler, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.EnrollEnrollErOttHandler = enroll.EnrollErOttHandlerFunc(func(params enroll.EnrollErOttParams) middleware.Responder { + ae.ClientApi.EnrollEnrollErOttHandler = enroll.EnrollErOttHandlerFunc(func(params enroll.EnrollErOttParams) middleware.Responder { return ae.IsAllowed(ro.enrollHandler, params.HTTPRequest, "", "", permissions.Always()) }) // Extend Enrollment - ae.Api.EnrollExtendRouterEnrollmentHandler = enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { + ae.ClientApi.EnrollExtendRouterEnrollmentHandler = enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { ro.extendRouterEnrollment(ae, rc, params) }, params.HTTPRequest, "", "", permissions.Always()) }) // Utility, well-known - ae.Api.WellKnownListWellKnownCasHandler = well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder { + ae.ClientApi.WellKnownListWellKnownCasHandler = well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder { return ae.IsAllowed(ro.getCaCerts, params.HTTPRequest, "", "", permissions.Always()) }) } diff --git a/controller/internal/routes/enrollment_router.go b/controller/internal/routes/enrollment_router.go index 086ffe2e5..42886fc34 100644 --- a/controller/internal/routes/enrollment_router.go +++ b/controller/internal/routes/enrollment_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/enrollment" + "github.com/openziti/edge/rest_management_api_server/operations/enrollment" ) func init() { @@ -41,15 +41,15 @@ func NewEnrollmentRouter() *EnrollmentRouter { func (r *EnrollmentRouter) Register(ae *env.AppEnv) { - ae.Api.EnrollmentDeleteEnrollmentHandler = enrollment.DeleteEnrollmentHandlerFunc(func(params enrollment.DeleteEnrollmentParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EnrollmentDeleteEnrollmentHandler = enrollment.DeleteEnrollmentHandlerFunc(func(params enrollment.DeleteEnrollmentParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EnrollmentDetailEnrollmentHandler = enrollment.DetailEnrollmentHandlerFunc(func(params enrollment.DetailEnrollmentParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EnrollmentDetailEnrollmentHandler = enrollment.DetailEnrollmentHandlerFunc(func(params enrollment.DetailEnrollmentParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.EnrollmentListEnrollmentsHandler = enrollment.ListEnrollmentsHandlerFunc(func(params enrollment.ListEnrollmentsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.EnrollmentListEnrollmentsHandler = enrollment.ListEnrollmentsHandlerFunc(func(params enrollment.ListEnrollmentsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/geo_region_api_model.go b/controller/internal/routes/geo_region_api_model.go deleted file mode 100644 index 5f60d384f..000000000 --- a/controller/internal/routes/geo_region_api_model.go +++ /dev/null @@ -1,61 +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 routes - -import ( - "fmt" - "github.com/michaelquigley/pfxlog" - "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" -) - -const EntityNameGeoRegion = "geo-regions" - -var GeoRegionLinkFactory = NewBasicLinkFactory(EntityNameGeoRegion) - -func MapGeoRegionToRestEntity(_ *env.AppEnv, _ *response.RequestContext, e models.Entity) (interface{}, error) { - geoRegion, ok := e.(*model.GeoRegion) - - if !ok { - err := fmt.Errorf("entity is not a GeoRegion \"%s\"", e.GetId()) - log := pfxlog.Logger() - log.Error(err) - return nil, err - } - - restModel, err := MapGeoRegionToRestModel(geoRegion) - - if err != nil { - err := fmt.Errorf("could not convert to API entity \"%s\": %s", e.GetId(), err) - log := pfxlog.Logger() - log.Error(err) - return nil, err - } - return restModel, nil -} - -func MapGeoRegionToRestModel(geoRegion *model.GeoRegion) (*rest_model.GeoRegionDetail, error) { - ret := &rest_model.GeoRegionDetail{ - BaseEntity: BaseEntityToRestModel(geoRegion, GeoRegionLinkFactory), - Name: &geoRegion.Name, - } - - return ret, nil -} diff --git a/controller/internal/routes/geo_region_router.go b/controller/internal/routes/geo_region_router.go deleted file mode 100644 index 98b244f2b..000000000 --- a/controller/internal/routes/geo_region_router.go +++ /dev/null @@ -1,59 +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 routes - -import ( - "github.com/go-openapi/runtime/middleware" - "github.com/openziti/edge/controller/env" - "github.com/openziti/edge/controller/internal/permissions" - "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/geo_region" -) - -func init() { - r := NewGeoRegionRouter() - env.AddRouter(r) -} - -type GeoRegionRouter struct { - BasePath string -} - -func NewGeoRegionRouter() *GeoRegionRouter { - return &GeoRegionRouter{ - BasePath: "/" + EntityNameGeoRegion, - } -} - -func (r *GeoRegionRouter) Register(ae *env.AppEnv) { - - ae.Api.GeoRegionDetailGeoRegionHandler = geo_region.DetailGeoRegionHandlerFunc(func(params geo_region.DetailGeoRegionParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) - }) - - ae.Api.GeoRegionListGeoRegionsHandler = geo_region.ListGeoRegionsHandlerFunc(func(params geo_region.ListGeoRegionsParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) - }) -} - -func (r *GeoRegionRouter) List(ae *env.AppEnv, rc *response.RequestContext) { - ListWithHandler(ae, rc, ae.Handlers.GeoRegion, MapGeoRegionToRestEntity) -} - -func (r *GeoRegionRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { - DetailWithHandler(ae, rc, ae.Handlers.GeoRegion, MapGeoRegionToRestEntity) -} diff --git a/controller/internal/routes/identity_api_model.go b/controller/internal/routes/identity_api_model.go index 2b030c29f..5ae80611e 100644 --- a/controller/internal/routes/identity_api_model.go +++ b/controller/internal/routes/identity_api_model.go @@ -61,8 +61,12 @@ func (factory *IdentityLinkFactoryImpl) Links(entity models.Entity) rest_model.L return links } -func getDefaultHostingCost(v rest_model.TerminatorCost) uint16 { - return uint16(v) +func getDefaultHostingCost(v *rest_model.TerminatorCost) uint16 { + if v == nil { + return 0 + } + + return uint16(*v) } func getServiceHostingPrecedences(v rest_model.TerminatorPrecedenceMap) map[string]ziti.Precedence { @@ -81,18 +85,19 @@ func getRestServiceHostingPrecedences(v map[string]ziti.Precedence) rest_model.T return result } -func getServiceHostingCosts(v rest_model.TerminatorCostMap) map[string]uint16 { +func getServiceHostingCosts(costMap rest_model.TerminatorCostMap) map[string]uint16 { result := map[string]uint16{} - for k, v := range v { - result[k] = uint16(v) + for key, cost := range costMap { + result[key] = uint16(*cost) } return result } -func getRestServiceHostingCosts(v map[string]uint16) rest_model.TerminatorCostMap { +func getRestServiceHostingCosts(costMap map[string]uint16) rest_model.TerminatorCostMap { result := rest_model.TerminatorCostMap{} - for k, v := range v { - result[k] = rest_model.TerminatorCost(v) + for key, cost := range costMap { + val := rest_model.TerminatorCost(cost) + result[key] = &val } return result } @@ -224,6 +229,8 @@ func MapIdentityToRestModel(ae *env.AppEnv, identity *model.Identity) (*rest_mod pfxlog.Logger().Errorf("error attempting to determine identity id's [%s] API session existence: %v", identity.Id, err) } + cost := rest_model.TerminatorCost(identity.DefaultHostingCost) + ret := &rest_model.IdentityDetail{ BaseEntity: BaseEntityToRestModel(identity, IdentityLinkFactory), IsAdmin: &identity.IsAdmin, @@ -235,7 +242,7 @@ func MapIdentityToRestModel(ae *env.AppEnv, identity *model.Identity) (*rest_mod HasEdgeRouterConnection: &identity.HasHeartbeat, HasAPISession: &hasApiSession, DefaultHostingPrecedence: rest_model.TerminatorPrecedence(identity.DefaultHostingPrecedence.String()), - DefaultHostingCost: rest_model.TerminatorCost(identity.DefaultHostingCost), + DefaultHostingCost: &cost, ServiceHostingPrecedences: getRestServiceHostingPrecedences(identity.ServiceHostingPrecedences), ServiceHostingCosts: getRestServiceHostingCosts(identity.ServiceHostingCosts), IsMfaEnabled: &isMfaEnabled, diff --git a/controller/internal/routes/identity_router.go b/controller/internal/routes/identity_router.go index c966e1381..5c376b97b 100644 --- a/controller/internal/routes/identity_router.go +++ b/controller/internal/routes/identity_router.go @@ -24,8 +24,8 @@ import ( "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/identity" "github.com/openziti/edge/rest_model" - "github.com/openziti/edge/rest_server/operations/identity" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/storage/ast" "github.com/openziti/foundation/storage/boltz" @@ -49,83 +49,83 @@ func NewIdentityRouter() *IdentityRouter { func (r *IdentityRouter) Register(ae *env.AppEnv) { //identity crud - ae.Api.IdentityDeleteIdentityHandler = identity.DeleteIdentityHandlerFunc(func(params identity.DeleteIdentityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityDeleteIdentityHandler = identity.DeleteIdentityHandlerFunc(func(params identity.DeleteIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityDetailIdentityHandler = identity.DetailIdentityHandlerFunc(func(params identity.DetailIdentityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityDetailIdentityHandler = identity.DetailIdentityHandlerFunc(func(params identity.DetailIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityListIdentitiesHandler = identity.ListIdentitiesHandlerFunc(func(params identity.ListIdentitiesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentitiesHandler = identity.ListIdentitiesHandlerFunc(func(params identity.ListIdentitiesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.IdentityUpdateIdentityHandler = identity.UpdateIdentityHandlerFunc(func(params identity.UpdateIdentityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityUpdateIdentityHandler = identity.UpdateIdentityHandlerFunc(func(params identity.UpdateIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityCreateIdentityHandler = identity.CreateIdentityHandlerFunc(func(params identity.CreateIdentityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityCreateIdentityHandler = identity.CreateIdentityHandlerFunc(func(params identity.CreateIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.IdentityPatchIdentityHandler = identity.PatchIdentityHandlerFunc(func(params identity.PatchIdentityParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityPatchIdentityHandler = identity.PatchIdentityHandlerFunc(func(params identity.PatchIdentityParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // edge router policies list - ae.Api.IdentityListIdentitysEdgeRouterPoliciesHandler = identity.ListIdentitysEdgeRouterPoliciesHandlerFunc(func(params identity.ListIdentitysEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentitysEdgeRouterPoliciesHandler = identity.ListIdentitysEdgeRouterPoliciesHandlerFunc(func(params identity.ListIdentitysEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listEdgeRouterPolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // edge routers list - ae.Api.IdentityListIdentityEdgeRoutersHandler = identity.ListIdentityEdgeRoutersHandlerFunc(func(params identity.ListIdentityEdgeRoutersParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentityEdgeRoutersHandler = identity.ListIdentityEdgeRoutersHandlerFunc(func(params identity.ListIdentityEdgeRoutersParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listEdgeRouters, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // service policies list - ae.Api.IdentityListIdentityServicePoliciesHandler = identity.ListIdentityServicePoliciesHandlerFunc(func(params identity.ListIdentityServicePoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentityServicePoliciesHandler = identity.ListIdentityServicePoliciesHandlerFunc(func(params identity.ListIdentityServicePoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServicePolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // service list - ae.Api.IdentityListIdentityServicesHandler = identity.ListIdentityServicesHandlerFunc(func(params identity.ListIdentityServicesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentityServicesHandler = identity.ListIdentityServicesHandlerFunc(func(params identity.ListIdentityServicesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServices, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // service configs crud - ae.Api.IdentityListIdentitysServiceConfigsHandler = identity.ListIdentitysServiceConfigsHandlerFunc(func(params identity.ListIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentitysServiceConfigsHandler = identity.ListIdentitysServiceConfigsHandlerFunc(func(params identity.ListIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServiceConfigs, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityAssociateIdentitysServiceConfigsHandler = identity.AssociateIdentitysServiceConfigsHandlerFunc(func(params identity.AssociateIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityAssociateIdentitysServiceConfigsHandler = identity.AssociateIdentitysServiceConfigsHandlerFunc(func(params identity.AssociateIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.assignServiceConfigs(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityDisassociateIdentitysServiceConfigsHandler = identity.DisassociateIdentitysServiceConfigsHandlerFunc(func(params identity.DisassociateIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityDisassociateIdentitysServiceConfigsHandler = identity.DisassociateIdentitysServiceConfigsHandlerFunc(func(params identity.DisassociateIdentitysServiceConfigsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.removeServiceConfigs(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // policy advice URL - ae.Api.IdentityGetIdentityPolicyAdviceHandler = identity.GetIdentityPolicyAdviceHandlerFunc(func(params identity.GetIdentityPolicyAdviceParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityGetIdentityPolicyAdviceHandler = identity.GetIdentityPolicyAdviceHandlerFunc(func(params identity.GetIdentityPolicyAdviceParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.getPolicyAdvice, params.HTTPRequest, params.ID, params.ServiceID, permissions.IsAdmin()) }) // posture data - ae.Api.IdentityGetIdentityPostureDataHandler = identity.GetIdentityPostureDataHandlerFunc(func(params identity.GetIdentityPostureDataParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityGetIdentityPostureDataHandler = identity.GetIdentityPostureDataHandlerFunc(func(params identity.GetIdentityPostureDataParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.getPostureData, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityGetIdentityFailedServiceRequestsHandler = identity.GetIdentityFailedServiceRequestsHandlerFunc(func(params identity.GetIdentityFailedServiceRequestsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityGetIdentityFailedServiceRequestsHandler = identity.GetIdentityFailedServiceRequestsHandlerFunc(func(params identity.GetIdentityFailedServiceRequestsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.getPostureDataFailedServiceRequests, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) // mfa - ae.Api.IdentityRemoveIdentityMfaHandler = identity.RemoveIdentityMfaHandlerFunc(func(params identity.RemoveIdentityMfaParams, i interface{}) middleware.Responder { + ae.ManagementApi.IdentityRemoveIdentityMfaHandler = identity.RemoveIdentityMfaHandlerFunc(func(params identity.RemoveIdentityMfaParams, i interface{}) middleware.Responder { return ae.IsAllowed(r.removeMfa, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } @@ -163,7 +163,7 @@ func getIdentityTypeId(ae *env.AppEnv, identityType rest_model.IdentityType) str func (r *IdentityRouter) Create(ae *env.AppEnv, rc *response.RequestContext, params identity.CreateIdentityParams) { Create(rc, rc, IdentityLinkFactory, func() (string, error) { - identityModel, enrollments := MapCreateIdentityToModel(params.Identity, getIdentityTypeId(ae, params.Identity.Type)) + identityModel, enrollments := MapCreateIdentityToModel(params.Identity, getIdentityTypeId(ae, *params.Identity.Type)) identityId, _, err := ae.Handlers.Identity.CreateWithEnrollments(identityModel, enrollments) return identityId, err }) @@ -175,7 +175,7 @@ func (r *IdentityRouter) Delete(ae *env.AppEnv, rc *response.RequestContext) { func (r *IdentityRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params identity.UpdateIdentityParams) { Update(rc, func(id string) error { - return ae.Handlers.Identity.Update(MapUpdateIdentityToModel(params.ID, params.Identity, getIdentityTypeId(ae, params.Identity.Type))) + return ae.Handlers.Identity.Update(MapUpdateIdentityToModel(params.ID, params.Identity, getIdentityTypeId(ae, *params.Identity.Type))) }) } diff --git a/controller/internal/routes/identity_type_router.go b/controller/internal/routes/identity_type_router.go index 34eda507c..82fe87546 100644 --- a/controller/internal/routes/identity_type_router.go +++ b/controller/internal/routes/identity_type_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/identity" + "github.com/openziti/edge/rest_management_api_server/operations/identity" ) func init() { @@ -41,11 +41,11 @@ func NewIdentityTypeRouter() *IdentityTypeRouter { func (r *IdentityTypeRouter) Register(ae *env.AppEnv) { - ae.Api.IdentityDetailIdentityTypeHandler = identity.DetailIdentityTypeHandlerFunc(func(params identity.DetailIdentityTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityDetailIdentityTypeHandler = identity.DetailIdentityTypeHandlerFunc(func(params identity.DetailIdentityTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.IdentityListIdentityTypesHandler = identity.ListIdentityTypesHandlerFunc(func(params identity.ListIdentityTypesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.IdentityListIdentityTypesHandler = identity.ListIdentityTypesHandlerFunc(func(params identity.ListIdentityTypesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) diff --git a/controller/internal/routes/posture_check_api_model.go b/controller/internal/routes/posture_check_api_model.go index 92438a959..63060f7e3 100644 --- a/controller/internal/routes/posture_check_api_model.go +++ b/controller/internal/routes/posture_check_api_model.go @@ -67,7 +67,7 @@ func MapCreatePostureCheckToModel(postureCheck rest_model.PostureCheckCreate) *m for _, os := range apiSubType.OperatingSystems { subType.OperatingSystems = append(subType.OperatingSystems, model.OperatingSystem{ - OsType: string(os.Type), + OsType: string(*os.Type), OsVersions: os.Versions, }) } @@ -83,7 +83,7 @@ func MapCreatePostureCheckToModel(postureCheck rest_model.PostureCheckCreate) *m } case *rest_model.PostureCheckProcessCreate: ret.SubType = &model.PostureCheckProcess{ - OsType: string(apiSubType.Process.OsType), + OsType: string(*apiSubType.Process.OsType), Path: *apiSubType.Process.Path, Hashes: apiSubType.Process.Hashes, Fingerprint: apiSubType.Process.SignerFingerprint, @@ -93,13 +93,13 @@ func MapCreatePostureCheckToModel(postureCheck rest_model.PostureCheckCreate) *m case *rest_model.PostureCheckProcessMultiCreate: apiCheck := postureCheck.(*rest_model.PostureCheckProcessMultiCreate) modelCheck := &model.PostureCheckProcessMulti{ - Semantic: string(apiCheck.Semantic), + Semantic: string(*apiCheck.Semantic), } for _, process := range apiCheck.Processes { newProc := &model.ProcessMulti{ Hashes: process.Hashes, - OsType: string(process.OsType), + OsType: string(*process.OsType), Path: *process.Path, SignerFingerprints: process.SignerFingerprints, } @@ -138,7 +138,7 @@ func MapUpdatePostureCheckToModel(id string, postureCheck rest_model.PostureChec case *rest_model.PostureCheckProcessUpdate: check := postureCheck.(*rest_model.PostureCheckProcessUpdate) ret.SubType = &model.PostureCheckProcess{ - OsType: string(check.Process.OsType), + OsType: string(*check.Process.OsType), Path: stringz.OrEmpty(check.Process.Path), Hashes: check.Process.Hashes, Fingerprint: check.Process.SignerFingerprint, @@ -150,7 +150,7 @@ func MapUpdatePostureCheckToModel(id string, postureCheck rest_model.PostureChec for _, restOs := range check.OperatingSystems { modelOs := model.OperatingSystem{ - OsType: string(restOs.Type), + OsType: string(*restOs.Type), OsVersions: restOs.Versions, } osCheck.OperatingSystems = append(osCheck.OperatingSystems, modelOs) @@ -160,13 +160,13 @@ func MapUpdatePostureCheckToModel(id string, postureCheck rest_model.PostureChec case *rest_model.PostureCheckProcessMultiUpdate: apiCheck := postureCheck.(*rest_model.PostureCheckProcessMultiUpdate) modelCheck := &model.PostureCheckProcessMulti{ - Semantic: string(apiCheck.Semantic), + Semantic: string(*apiCheck.Semantic), } for _, process := range apiCheck.Processes { newProc := &model.ProcessMulti{ Hashes: process.Hashes, - OsType: string(process.OsType), + OsType: string(*process.OsType), Path: *process.Path, SignerFingerprints: process.SignerFingerprints, } @@ -213,7 +213,7 @@ func MapPatchPostureCheckToModel(id string, postureCheck rest_model.PostureCheck ret.SubType = subType if check.Process != nil { - subType.OsType = string(check.Process.OsType) + subType.OsType = string(*check.Process.OsType) subType.Path = stringz.OrEmpty(check.Process.Path) subType.Hashes = check.Process.Hashes subType.Fingerprint = check.Process.SignerFingerprint @@ -227,7 +227,7 @@ func MapPatchPostureCheckToModel(id string, postureCheck rest_model.PostureCheck for _, restOs := range check.OperatingSystems { modelOs := model.OperatingSystem{ - OsType: string(restOs.Type), + OsType: string(*restOs.Type), OsVersions: restOs.Versions, } osCheck.OperatingSystems = append(osCheck.OperatingSystems, modelOs) @@ -246,7 +246,7 @@ func MapPatchPostureCheckToModel(id string, postureCheck rest_model.PostureCheck for _, process := range apiCheck.Processes { newProc := &model.ProcessMulti{ Hashes: process.Hashes, - OsType: string(process.OsType), + OsType: string(*process.OsType), Path: *process.Path, SignerFingerprints: process.SignerFingerprints, } @@ -307,8 +307,9 @@ func MapPostureCheckToRestModel(i *model.PostureCheck) (rest_model.PostureCheckD osArray := []*rest_model.OperatingSystem{} for _, osMatch := range subType.OperatingSystems { + osType := rest_model.OsType(osMatch.OsType) osArray = append(osArray, &rest_model.OperatingSystem{ - Type: rest_model.OsType(osMatch.OsType), + Type: &osType, Versions: osMatch.OsVersions, }) } @@ -320,9 +321,11 @@ func MapPostureCheckToRestModel(i *model.PostureCheck) (rest_model.PostureCheckD setBaseEntityDetailsOnPostureCheck(ret, i) case *model.PostureCheckProcess: + osType := rest_model.OsType(subType.OsType) + processMatch := &rest_model.Process{ Hashes: subType.Hashes, - OsType: rest_model.OsType(subType.OsType), + OsType: &osType, Path: &subType.Path, SignerFingerprint: subType.Fingerprint, } @@ -346,15 +349,17 @@ func MapPostureCheckToRestModel(i *model.PostureCheck) (rest_model.PostureCheckD ret = &rest_model.PostureCheckMfaDetail{} setBaseEntityDetailsOnPostureCheck(ret, i) case *model.PostureCheckProcessMulti: + semantic := rest_model.Semantic(subType.Semantic) detail := &rest_model.PostureCheckProcessMultiDetail{ Processes: []*rest_model.ProcessMulti{}, - Semantic: rest_model.Semantic(subType.Semantic), + Semantic: &semantic, } for _, process := range subType.Processes { + osType := rest_model.OsType(process.OsType) newProc := &rest_model.ProcessMulti{ Hashes: process.Hashes, - OsType: rest_model.OsType(process.OsType), + OsType: &osType, Path: &process.Path, SignerFingerprints: process.SignerFingerprints, } diff --git a/controller/internal/routes/posture_check_router.go b/controller/internal/routes/posture_check_router.go index dacb4b398..0e4382f0f 100644 --- a/controller/internal/routes/posture_check_router.go +++ b/controller/internal/routes/posture_check_router.go @@ -22,7 +22,7 @@ import ( "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/posture_checks" + "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" "github.com/openziti/fabric/controller/models" ) @@ -42,27 +42,27 @@ func NewPostureCheckRouter() *PostureCheckRouter { } func (r *PostureCheckRouter) Register(ae *env.AppEnv) { - ae.Api.PostureChecksDeletePostureCheckHandler = posture_checks.DeletePostureCheckHandlerFunc(func(params posture_checks.DeletePostureCheckParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksDeletePostureCheckHandler = posture_checks.DeletePostureCheckHandlerFunc(func(params posture_checks.DeletePostureCheckParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.PostureChecksDetailPostureCheckHandler = posture_checks.DetailPostureCheckHandlerFunc(func(params posture_checks.DetailPostureCheckParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksDetailPostureCheckHandler = posture_checks.DetailPostureCheckHandlerFunc(func(params posture_checks.DetailPostureCheckParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.PostureChecksListPostureChecksHandler = posture_checks.ListPostureChecksHandlerFunc(func(params posture_checks.ListPostureChecksParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksListPostureChecksHandler = posture_checks.ListPostureChecksHandlerFunc(func(params posture_checks.ListPostureChecksParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.PostureChecksUpdatePostureCheckHandler = posture_checks.UpdatePostureCheckHandlerFunc(func(params posture_checks.UpdatePostureCheckParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksUpdatePostureCheckHandler = posture_checks.UpdatePostureCheckHandlerFunc(func(params posture_checks.UpdatePostureCheckParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.PostureChecksCreatePostureCheckHandler = posture_checks.CreatePostureCheckHandlerFunc(func(params posture_checks.CreatePostureCheckParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksCreatePostureCheckHandler = posture_checks.CreatePostureCheckHandlerFunc(func(params posture_checks.CreatePostureCheckParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.PostureChecksPatchPostureCheckHandler = posture_checks.PatchPostureCheckHandlerFunc(func(params posture_checks.PatchPostureCheckParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksPatchPostureCheckHandler = posture_checks.PatchPostureCheckHandlerFunc(func(params posture_checks.PatchPostureCheckParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/posture_check_type_api_model.go b/controller/internal/routes/posture_check_type_api_model.go index 4c7e8c349..6b09d9837 100644 --- a/controller/internal/routes/posture_check_type_api_model.go +++ b/controller/internal/routes/posture_check_type_api_model.go @@ -50,9 +50,10 @@ func MapPostureCheckTypeToRestModel(postureCheckType *model.PostureCheckType) *r operatingSystems := []*rest_model.OperatingSystem{} for _, os := range postureCheckType.OperatingSystems { + osType := rest_model.OsType(os.OsType) newOs := &rest_model.OperatingSystem{ - Type: rest_model.OsType(os.OsType), + Type: &osType, Versions: os.OsVersions, } operatingSystems = append(operatingSystems, newOs) diff --git a/controller/internal/routes/posture_check_type_router.go b/controller/internal/routes/posture_check_type_router.go index ac2c4f701..7f8a50751 100644 --- a/controller/internal/routes/posture_check_type_router.go +++ b/controller/internal/routes/posture_check_type_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/posture_checks" + "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" ) func init() { @@ -41,11 +41,11 @@ func NewPostureCheckTypeRouter() *PostureCheckTypeRouter { func (r *PostureCheckTypeRouter) Register(ae *env.AppEnv) { - ae.Api.PostureChecksDetailPostureCheckTypeHandler = posture_checks.DetailPostureCheckTypeHandlerFunc(func(params posture_checks.DetailPostureCheckTypeParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksDetailPostureCheckTypeHandler = posture_checks.DetailPostureCheckTypeHandlerFunc(func(params posture_checks.DetailPostureCheckTypeParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.PostureChecksListPostureCheckTypesHandler = posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.PostureChecksListPostureCheckTypesHandler = posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) diff --git a/controller/internal/routes/posture_data_api_model.go b/controller/internal/routes/posture_data_api_model.go index 1fb7482dc..162938610 100644 --- a/controller/internal/routes/posture_data_api_model.go +++ b/controller/internal/routes/posture_data_api_model.go @@ -25,7 +25,7 @@ import ( "time" ) -func MapPostureDataToRestModel(ae *env.AppEnv, postureData *model.PostureData) *rest_model.PostureData { +func MapPostureDataToRestModel(_ *env.AppEnv, postureData *model.PostureData) *rest_model.PostureData { ret := &rest_model.PostureData{ Domain: MapPostureDataDomainToRestModel(&postureData.Domain), Mac: MapPostureDataMacToRestModel(&postureData.Mac), @@ -147,9 +147,10 @@ func MapPostureCheckFailureProcessToRestModel(failure *model.PostureCheckFailure ret.ActualValue.SignerFingerprints = val.ActualValue.SignerFingerprints ret.ActualValue.IsRunning = &val.ActualValue.IsRunning + osType := rest_model.OsType(val.ExpectedValue.OsType) ret.ExpectedValue.Hashes = val.ExpectedValue.Hashes ret.ExpectedValue.Path = &val.ExpectedValue.Path - ret.ExpectedValue.OsType = rest_model.OsType(val.ExpectedValue.OsType) + ret.ExpectedValue.OsType = &osType ret.ExpectedValue.SignerFingerprint = val.ExpectedValue.Fingerprint } else { pfxlog.Logger().Errorf("could not convert failure values of %T for posture check %s, expected process", failure.PostureCheckFailureValues, failure.PostureCheckId) @@ -169,7 +170,8 @@ func MapPostureCheckFailureProcessMultiToRestModel(failure *model.PostureCheckFa restResult.SetPostureCheckName(&failure.PostureCheckName) if val, ok := failure.PostureCheckFailureValues.(*model.PostureCheckFailureValuesProcessMulti); ok { - restResult.Semantic = rest_model.Semantic(val.ExpectedValue.Semantic) + semantic := rest_model.Semantic(val.ExpectedValue.Semantic) + restResult.Semantic = &semantic for _, valActual := range val.ActualValue { restActual := &rest_model.PostureCheckFailureProcessActual{ @@ -183,9 +185,10 @@ func MapPostureCheckFailureProcessMultiToRestModel(failure *model.PostureCheckFa } for _, valExpected := range val.ExpectedValue.Processes { + osType := rest_model.OsType(valExpected.OsType) restExpected := &rest_model.ProcessMulti{ Hashes: valExpected.Hashes, - OsType: rest_model.OsType(valExpected.OsType), + OsType: &osType, Path: &valExpected.Path, SignerFingerprints: valExpected.SignerFingerprints, } @@ -253,8 +256,10 @@ func MapPostureCheckFailureOsToRestModel(failure *model.PostureCheckFailure) *re ret.ExpectedValue = []*rest_model.OperatingSystem{} for _, os := range val.ExpectedValue { + osType := rest_model.OsType(os.OsType) + newOs := &rest_model.OperatingSystem{ - Type: rest_model.OsType(os.OsType), + Type: &osType, Versions: os.OsVersions, } ret.ExpectedValue = append(ret.ExpectedValue, newOs) @@ -285,11 +290,11 @@ func MapPostureCheckFailureMfaToRestModel(failure *model.PostureCheckFailure) *r return ret } -func MapPostureDataFailedSessionRequestToRestModel(modelFailedSessionRequests []*model.PostureSessionRequestFailure) []*rest_model.FailedSessionRequest { - ret := []*rest_model.FailedSessionRequest{} +func MapPostureDataFailedSessionRequestToRestModel(modelFailedSessionRequests []*model.PostureSessionRequestFailure) []*rest_model.FailedServiceRequest { + ret := []*rest_model.FailedServiceRequest{} for _, modelFailedSessionRequest := range modelFailedSessionRequests { - failedSessionRequest := &rest_model.FailedSessionRequest{ + failedSessionRequest := &rest_model.FailedServiceRequest{ APISessionID: modelFailedSessionRequest.ApiSessionId, PolicyFailures: []*rest_model.PolicyFailure{}, ServiceID: modelFailedSessionRequest.ServiceId, diff --git a/controller/internal/routes/posture_response_api_model.go b/controller/internal/routes/posture_response_api_model.go index 0071826cf..931f4283b 100644 --- a/controller/internal/routes/posture_response_api_model.go +++ b/controller/internal/routes/posture_response_api_model.go @@ -16,12 +16,6 @@ package routes -import ( - "github.com/openziti/edge/controller/env" - "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" -) - const ( EntityNamePostureResponse = "posture-response" EntityNamePostureData = "posture-data" @@ -30,6 +24,3 @@ const ( var PostureResponseLinkFactory = NewBasicLinkFactory(EntityNamePostureResponse) -func MapCreatePostureResponseToModel(ae *env.AppEnv, rc *response.RequestContext, postureResponse rest_model.PostureResponseCreate) { - -} diff --git a/controller/internal/routes/posture_response_router.go b/controller/internal/routes/posture_response_router.go index 1961523a6..5ee5c5329 100644 --- a/controller/internal/routes/posture_response_router.go +++ b/controller/internal/routes/posture_response_router.go @@ -22,8 +22,8 @@ import ( "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" - "github.com/openziti/edge/rest_server/operations/posture_checks" "time" ) @@ -43,11 +43,11 @@ func NewPostureResponseRouter() *PostureResponseRouter { } func (r *PostureResponseRouter) Register(ae *env.AppEnv) { - ae.Api.PostureChecksCreatePostureResponseHandler = posture_checks.CreatePostureResponseHandlerFunc(func(params posture_checks.CreatePostureResponseParams, _ interface{}) middleware.Responder { + ae.ClientApi.PostureChecksCreatePostureResponseHandler = posture_checks.CreatePostureResponseHandlerFunc(func(params posture_checks.CreatePostureResponseParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.PostureChecksCreatePostureResponseBulkHandler = posture_checks.CreatePostureResponseBulkHandlerFunc(func(params posture_checks.CreatePostureResponseBulkParams, _ interface{}) middleware.Responder { + ae.ClientApi.PostureChecksCreatePostureResponseBulkHandler = posture_checks.CreatePostureResponseBulkHandlerFunc(func(params posture_checks.CreatePostureResponseBulkParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.CreateBulk(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) } @@ -120,9 +120,9 @@ func (r *PostureResponseRouter) handlePostureResponse(ae *env.AppEnv, rc *respon } subType := &model.PostureResponseProcess{ - Path: *apiPostureResponse.Path, - IsRunning: *apiPostureResponse.IsRunning, - BinaryHash: *apiPostureResponse.Hash, + Path: apiPostureResponse.Path, + IsRunning: apiPostureResponse.IsRunning, + BinaryHash: apiPostureResponse.Hash, SignerFingerprints: apiPostureResponse.SignerFingerprints, } diff --git a/controller/internal/routes/protocol_router.go b/controller/internal/routes/protocol_router.go index 18627bc54..aec904d4e 100644 --- a/controller/internal/routes/protocol_router.go +++ b/controller/internal/routes/protocol_router.go @@ -21,8 +21,8 @@ import ( "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" - "github.com/openziti/edge/rest_server/operations/informational" ) func init() { @@ -41,7 +41,7 @@ func NewProtocolRouter() *ProtocolRouter { } func (router *ProtocolRouter) Register(ae *env.AppEnv) { - ae.Api.InformationalListProtocolsHandler = informational.ListProtocolsHandlerFunc(func(params informational.ListProtocolsParams) middleware.Responder { + ae.ClientApi.InformationalListProtocolsHandler = informational.ListProtocolsHandlerFunc(func(params informational.ListProtocolsParams) middleware.Responder { return ae.IsAllowed(router.List, params.HTTPRequest, "", "", permissions.Always()) }) } diff --git a/controller/internal/routes/query_options.go b/controller/internal/routes/query_options.go index 97bcaa312..2c8a4e497 100644 --- a/controller/internal/routes/query_options.go +++ b/controller/internal/routes/query_options.go @@ -26,12 +26,9 @@ import ( const ( LimitMax = 500 - OffsetMax = 100000 - LimitDefault = 10 - OffsetDefault = 0 ) -// Represents external query options, which limits some query options (i.e. return all vs max limit). PublicQueryOptions +// PublicQueryOptions represents external query options, which limits some query options (i.e. return all vs max limit). PublicQueryOptions // can be used internally as long as the public option limitations are fitting. type PublicQueryOptions struct { Predicate string diff --git a/controller/internal/routes/role_attributes_router.go b/controller/internal/routes/role_attributes_router.go index c9501ba76..a3968613f 100644 --- a/controller/internal/routes/role_attributes_router.go +++ b/controller/internal/routes/role_attributes_router.go @@ -21,8 +21,8 @@ import ( "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/edge/rest_server/operations/role_attributes" "github.com/openziti/fabric/controller/models" ) @@ -38,15 +38,15 @@ func NewRoleAttributesRouter() *RoleAttributesRouter { } func (r *RoleAttributesRouter) Register(ae *env.AppEnv) { - ae.Api.RoleAttributesListEdgeRouterRoleAttributesHandler = role_attributes.ListEdgeRouterRoleAttributesHandlerFunc(func(params role_attributes.ListEdgeRouterRoleAttributesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.RoleAttributesListEdgeRouterRoleAttributesHandler = role_attributes.ListEdgeRouterRoleAttributesHandlerFunc(func(params role_attributes.ListEdgeRouterRoleAttributesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listEdgeRouterRoleAttributes, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.RoleAttributesListIdentityRoleAttributesHandler = role_attributes.ListIdentityRoleAttributesHandlerFunc(func(params role_attributes.ListIdentityRoleAttributesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.RoleAttributesListIdentityRoleAttributesHandler = role_attributes.ListIdentityRoleAttributesHandlerFunc(func(params role_attributes.ListIdentityRoleAttributesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listIdentityRoleAttributes, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.RoleAttributesListServiceRoleAttributesHandler = role_attributes.ListServiceRoleAttributesHandlerFunc(func(params role_attributes.ListServiceRoleAttributesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.RoleAttributesListServiceRoleAttributesHandler = role_attributes.ListServiceRoleAttributesHandlerFunc(func(params role_attributes.ListServiceRoleAttributesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServiceRoleAttributes, params.HTTPRequest, "", "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/transit_router_api_model.go b/controller/internal/routes/router_api_model.go similarity index 90% rename from controller/internal/routes/transit_router_api_model.go rename to controller/internal/routes/router_api_model.go index 90fa23989..b5fe50b3c 100644 --- a/controller/internal/routes/transit_router_api_model.go +++ b/controller/internal/routes/router_api_model.go @@ -16,7 +16,7 @@ const EntityNameTransitRouter = "transit-routers" var TransitRouterLinkFactory = NewBasicLinkFactory(EntityNameTransitRouter) -func MapCreateTransitRouterToModel(router *rest_model.TransitRouterCreate) *model.TransitRouter { +func MapCreateRouterToModel(router *rest_model.RouterCreate) *model.TransitRouter { ret := &model.TransitRouter{ BaseEntity: models.BaseEntity{}, Name: stringz.OrEmpty(router.Name), @@ -25,7 +25,7 @@ func MapCreateTransitRouterToModel(router *rest_model.TransitRouterCreate) *mode return ret } -func MapUpdateTransitRouterToModel(id string, router *rest_model.TransitRouterUpdate) *model.TransitRouter { +func MapUpdateTransitRouterToModel(id string, router *rest_model.RouterUpdate) *model.TransitRouter { ret := &model.TransitRouter{ BaseEntity: models.BaseEntity{ Tags: router.Tags, @@ -37,7 +37,7 @@ func MapUpdateTransitRouterToModel(id string, router *rest_model.TransitRouterUp return ret } -func MapPatchTransitRouterToModel(id string, router *rest_model.TransitRouterPatch) *model.TransitRouter { +func MapPatchTransitRouterToModel(id string, router *rest_model.RouterPatch) *model.TransitRouter { ret := &model.TransitRouter{ BaseEntity: models.BaseEntity{ Tags: router.Tags, @@ -70,9 +70,9 @@ func MapTransitRouterToRestEntity(ae *env.AppEnv, _ *response.RequestContext, e return restModel, nil } -func MapTransitRouterToRestModel(ae *env.AppEnv, router *model.TransitRouter) (*rest_model.TransitRouterDetail, error) { +func MapTransitRouterToRestModel(ae *env.AppEnv, router *model.TransitRouter) (*rest_model.RouterDetail, error) { isConnected := ae.GetHandlers().Router.IsConnected(router.GetId()) - ret := &rest_model.TransitRouterDetail{ + ret := &rest_model.RouterDetail{ BaseEntity: BaseEntityToRestModel(router, TransitRouterLinkFactory), Fingerprint: router.Fingerprint, IsOnline: &isConnected, diff --git a/controller/internal/routes/router_router.go b/controller/internal/routes/router_router.go new file mode 100644 index 000000000..e13dff5c5 --- /dev/null +++ b/controller/internal/routes/router_router.go @@ -0,0 +1,124 @@ +/* + Copyright NetFoundry, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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 routes + +import ( + "github.com/go-openapi/runtime/middleware" + "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" +) + +func init() { + r := NewTransitRouterRouter() + env.AddRouter(r) +} + +type TransitRouterRouter struct { + BasePath string +} + +func NewTransitRouterRouter() *TransitRouterRouter { + return &TransitRouterRouter{ + BasePath: "/" + EntityNameTransitRouter, + } +} + +func (r *TransitRouterRouter) Register(ae *env.AppEnv) { + //Router + ae.ManagementApi.RouterDeleteRouterHandler = router.DeleteRouterHandlerFunc(func(params router.DeleteRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterDetailRouterHandler = router.DetailRouterHandlerFunc(func(params router.DetailRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterListRoutersHandler = router.ListRoutersHandlerFunc(func(params router.ListRoutersParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterUpdateRouterHandler = router.UpdateRouterHandlerFunc(func(params router.UpdateRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params.ID, params.Router) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterCreateRouterHandler = router.CreateRouterHandlerFunc(func(params router.CreateRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params.Router) }, params.HTTPRequest, "", "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterPatchRouterHandler = router.PatchRouterHandlerFunc(func(params router.PatchRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params.ID, params.Router) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + + //Transit Router (deprecated) + ae.ManagementApi.RouterDeleteTransitRouterHandler = router.DeleteTransitRouterHandlerFunc(func(params router.DeleteTransitRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterDetailTransitRouterHandler = router.DetailTransitRouterHandlerFunc(func(params router.DetailTransitRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterListTransitRoutersHandler = router.ListTransitRoutersHandlerFunc(func(params router.ListTransitRoutersParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterUpdateTransitRouterHandler = router.UpdateTransitRouterHandlerFunc(func(params router.UpdateTransitRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params.ID, params.Router) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterCreateTransitRouterHandler = router.CreateTransitRouterHandlerFunc(func(params router.CreateTransitRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params.Router) }, params.HTTPRequest, "", "", permissions.IsAdmin()) + }) + + ae.ManagementApi.RouterPatchTransitRouterHandler = router.PatchTransitRouterHandlerFunc(func(params router.PatchTransitRouterParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params.ID, params.Router) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) + }) +} + +func (r *TransitRouterRouter) List(ae *env.AppEnv, rc *response.RequestContext) { + ListWithHandler(ae, rc, ae.Handlers.TransitRouter, MapTransitRouterToRestEntity) +} + +func (r *TransitRouterRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { + DetailWithHandler(ae, rc, ae.Handlers.TransitRouter, MapTransitRouterToRestEntity) +} + +func (r *TransitRouterRouter) Create(ae *env.AppEnv, rc *response.RequestContext, router *rest_model.RouterCreate) { + Create(rc, rc, TransitRouterLinkFactory, func() (string, error) { + return ae.Handlers.TransitRouter.Create(MapCreateRouterToModel(router)) + }) +} + +func (r *TransitRouterRouter) Delete(ae *env.AppEnv, rc *response.RequestContext) { + DeleteWithHandler(rc, ae.Handlers.TransitRouter) +} + +func (r *TransitRouterRouter) Update(ae *env.AppEnv, rc *response.RequestContext, routerId string, router *rest_model.RouterUpdate) { + Update(rc, func(id string) error { + return ae.Handlers.TransitRouter.Update(MapUpdateTransitRouterToModel(routerId, router), false) + }) +} + +func (r *TransitRouterRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, routerId string, router *rest_model.RouterPatch) { + Patch(rc, func(id string, fields JsonFields) error { + return ae.Handlers.TransitRouter.Patch(MapPatchTransitRouterToModel(routerId, router), fields.ConcatNestedNames().FilterMaps("tags"), false) + }) +} diff --git a/controller/internal/routes/service_api_model.go b/controller/internal/routes/service_api_model.go index 9fede3119..9ee0c07c1 100644 --- a/controller/internal/routes/service_api_model.go +++ b/controller/internal/routes/service_api_model.go @@ -209,13 +209,14 @@ func MapServiceToRestModel(ae *env.AppEnv, rc *response.RequestContext, service func PostureCheckToQueries(check *model.PostureCheck) *rest_model.PostureQuery { isPassing := false + queryType := rest_model.PostureCheckType(check.TypeId) ret := &rest_model.PostureQuery{ BaseEntity: BaseEntityToRestModel(check, PostureCheckLinkFactory), IsPassing: &isPassing, - QueryType: rest_model.PostureCheckType(check.TypeId), + QueryType: &queryType, } - switch ret.QueryType { + switch *ret.QueryType { case rest_model.PostureCheckTypePROCESS: processCheck := check.SubType.(*model.PostureCheckProcess) ret.Process = &rest_model.PostureQueryProcess{ 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 4c2b2e41b..da01b3621 100644 --- a/controller/internal/routes/service_edge_router_policy_api_model.go +++ b/controller/internal/routes/service_edge_router_policy_api_model.go @@ -114,14 +114,16 @@ func MapServiceEdgeRouterPolicyToRestEntity(ae *env.AppEnv, _ *response.RequestC } func MapServiceEdgeRouterPolicyToRestModel(ae *env.AppEnv, policy *model.ServiceEdgeRouterPolicy) (*rest_model.ServiceEdgeRouterPolicyDetail, error) { + semantic := rest_model.Semantic(policy.Semantic) + ret := &rest_model.ServiceEdgeRouterPolicyDetail{ - BaseEntity: BaseEntityToRestModel(policy, ServiceEdgeRouterPolicyLinkFactory), - EdgeRouterRoles: policy.EdgeRouterRoles, + BaseEntity: BaseEntityToRestModel(policy, ServiceEdgeRouterPolicyLinkFactory), + EdgeRouterRoles: policy.EdgeRouterRoles, EdgeRouterRolesDisplay: GetNamedEdgeRouterRoles(ae.GetHandlers().EdgeRouter, policy.EdgeRouterRoles), - Name: &policy.Name, - Semantic: rest_model.Semantic(policy.Semantic), - ServiceRoles: policy.ServiceRoles, - ServiceRolesDisplay: GetNamedServiceRoles(ae.GetHandlers().EdgeService, policy.ServiceRoles), + Name: &policy.Name, + Semantic: &semantic, + ServiceRoles: policy.ServiceRoles, + ServiceRolesDisplay: GetNamedServiceRoles(ae.GetHandlers().EdgeService, policy.ServiceRoles), } return ret, nil diff --git a/controller/internal/routes/service_edge_router_policy_router.go b/controller/internal/routes/service_edge_router_policy_router.go index c3745e3f7..564eb179a 100644 --- a/controller/internal/routes/service_edge_router_policy_router.go +++ b/controller/internal/routes/service_edge_router_policy_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/service_edge_router_policy" + "github.com/openziti/edge/rest_management_api_server/operations/service_edge_router_policy" ) func init() { @@ -41,36 +41,36 @@ func NewServiceEdgeRouterPolicyRouter() *ServiceEdgeRouterPolicyRouter { func (r *ServiceEdgeRouterPolicyRouter) Register(ae *env.AppEnv) { // CRUD - ae.Api.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler = service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DeleteServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler = service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DeleteServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler = service_edge_router_policy.DetailServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DetailServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler = service_edge_router_policy.DetailServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DetailServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler = service_edge_router_policy.ListServiceEdgeRouterPoliciesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler = service_edge_router_policy.ListServiceEdgeRouterPoliciesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler = service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.UpdateServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler = service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.UpdateServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler = service_edge_router_policy.CreateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.CreateServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler = service_edge_router_policy.CreateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.CreateServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler = service_edge_router_policy.PatchServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.PatchServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler = service_edge_router_policy.PatchServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.PatchServiceEdgeRouterPolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) //Additional Lists - ae.Api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListEdgeRouters, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyServicesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyServicesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListServices, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/service_policy_api_model.go b/controller/internal/routes/service_policy_api_model.go index a07fcca14..1361443fb 100644 --- a/controller/internal/routes/service_policy_api_model.go +++ b/controller/internal/routes/service_policy_api_model.go @@ -56,7 +56,7 @@ func MapCreateServicePolicyToModel(policy *rest_model.ServicePolicyCreate) *mode Tags: policy.Tags, }, Name: stringz.OrEmpty(policy.Name), - PolicyType: string(policy.Type), + PolicyType: string(*policy.Type), Semantic: string(policy.Semantic), ServiceRoles: policy.ServiceRoles, IdentityRoles: policy.IdentityRoles, @@ -73,7 +73,7 @@ func MapUpdateServicePolicyToModel(id string, policy *rest_model.ServicePolicyUp Id: id, }, Name: stringz.OrEmpty(policy.Name), - PolicyType: string(policy.Type), + PolicyType: string(*policy.Type), Semantic: string(policy.Semantic), ServiceRoles: policy.ServiceRoles, IdentityRoles: policy.IdentityRoles, @@ -122,15 +122,18 @@ func MapServicePolicyToRestEntity(ae *env.AppEnv, _ *response.RequestContext, e } func MapServicePolicyToRestModel(ae *env.AppEnv, policy *model.ServicePolicy) (*rest_model.ServicePolicyDetail, error) { + semantic := rest_model.Semantic(policy.Semantic) + dialBindType := rest_model.DialBind(policy.PolicyType) + ret := &rest_model.ServicePolicyDetail{ BaseEntity: BaseEntityToRestModel(policy, ServicePolicyLinkFactory), IdentityRoles: policy.IdentityRoles, IdentityRolesDisplay: GetNamedIdentityRoles(ae.GetHandlers().Identity, policy.IdentityRoles), Name: &policy.Name, - Semantic: rest_model.Semantic(policy.Semantic), + Semantic: &semantic, ServiceRoles: policy.ServiceRoles, ServiceRolesDisplay: GetNamedServiceRoles(ae.GetHandlers().EdgeService, policy.ServiceRoles), - Type: rest_model.DialBind(policy.PolicyType), + Type: &dialBindType, PostureCheckRoles: policy.PostureCheckRoles, PostureCheckRolesDisplay: GetNamedPostureCheckRoles(ae.GetHandlers().PostureCheck, policy.PostureCheckRoles), } diff --git a/controller/internal/routes/service_policy_router.go b/controller/internal/routes/service_policy_router.go index 139e9826a..214d7066e 100644 --- a/controller/internal/routes/service_policy_router.go +++ b/controller/internal/routes/service_policy_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/service_policy" + "github.com/openziti/edge/rest_management_api_server/operations/service_policy" ) func init() { @@ -41,40 +41,40 @@ func NewServicePolicyRouter() *ServicePolicyRouter { func (r *ServicePolicyRouter) Register(ae *env.AppEnv) { //CRUD - ae.Api.ServicePolicyDeleteServicePolicyHandler = service_policy.DeleteServicePolicyHandlerFunc(func(params service_policy.DeleteServicePolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyDeleteServicePolicyHandler = service_policy.DeleteServicePolicyHandlerFunc(func(params service_policy.DeleteServicePolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyDetailServicePolicyHandler = service_policy.DetailServicePolicyHandlerFunc(func(params service_policy.DetailServicePolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyDetailServicePolicyHandler = service_policy.DetailServicePolicyHandlerFunc(func(params service_policy.DetailServicePolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyListServicePoliciesHandler = service_policy.ListServicePoliciesHandlerFunc(func(params service_policy.ListServicePoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyListServicePoliciesHandler = service_policy.ListServicePoliciesHandlerFunc(func(params service_policy.ListServicePoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyUpdateServicePolicyHandler = service_policy.UpdateServicePolicyHandlerFunc(func(params service_policy.UpdateServicePolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyUpdateServicePolicyHandler = service_policy.UpdateServicePolicyHandlerFunc(func(params service_policy.UpdateServicePolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyCreateServicePolicyHandler = service_policy.CreateServicePolicyHandlerFunc(func(params service_policy.CreateServicePolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyCreateServicePolicyHandler = service_policy.CreateServicePolicyHandlerFunc(func(params service_policy.CreateServicePolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyPatchServicePolicyHandler = service_policy.PatchServicePolicyHandlerFunc(func(params service_policy.PatchServicePolicyParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyPatchServicePolicyHandler = service_policy.PatchServicePolicyHandlerFunc(func(params service_policy.PatchServicePolicyParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) //Additional Lists - ae.Api.ServicePolicyListServicePolicyServicesHandler = service_policy.ListServicePolicyServicesHandlerFunc(func(params service_policy.ListServicePolicyServicesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyListServicePolicyServicesHandler = service_policy.ListServicePolicyServicesHandlerFunc(func(params service_policy.ListServicePolicyServicesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListServices, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyListServicePolicyIdentitiesHandler = service_policy.ListServicePolicyIdentitiesHandlerFunc(func(params service_policy.ListServicePolicyIdentitiesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyListServicePolicyIdentitiesHandler = service_policy.ListServicePolicyIdentitiesHandlerFunc(func(params service_policy.ListServicePolicyIdentitiesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListIdentities, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServicePolicyListServicePolicyPostureChecksHandler = service_policy.ListServicePolicyPostureChecksHandlerFunc(func(params service_policy.ListServicePolicyPostureChecksParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePolicyListServicePolicyPostureChecksHandler = service_policy.ListServicePolicyPostureChecksHandlerFunc(func(params service_policy.ListServicePolicyPostureChecksParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.ListPostureChecks, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/service_router.go b/controller/internal/routes/service_router.go index f9b79f10e..410a8f03b 100644 --- a/controller/internal/routes/service_router.go +++ b/controller/internal/routes/service_router.go @@ -20,7 +20,8 @@ import ( "fmt" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" - "github.com/openziti/edge/rest_server/operations/service" + clientService "github.com/openziti/edge/rest_client_api_server/operations/service" + managementService "github.com/openziti/edge/rest_management_api_server/operations/service" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/metrics" "github.com/openziti/foundation/storage/boltz" @@ -52,70 +53,82 @@ func NewServiceRouter() *ServiceRouter { func (r *ServiceRouter) Register(ae *env.AppEnv) { r.listTimer = ae.GetHostController().GetNetwork().GetMetricsRegistry().Timer("services.list") - ae.Api.ServiceDeleteServiceHandler = service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, _ interface{}) middleware.Responder { + //Client + ae.ClientApi.ServiceListServicesHandler = clientService.ListServicesHandlerFunc(func(params clientService.ListServicesParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.ListClientServices, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ClientApi.ServiceDetailServiceHandler = clientService.DetailServiceHandlerFunc(func(params clientService.DetailServiceParams, _ interface{}) middleware.Responder { + //r.Detail limits by identity + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + ae.ClientApi.ServiceListServiceTerminatorsHandler = clientService.ListServiceTerminatorsHandlerFunc(func(params clientService.ListServiceTerminatorsParams, i interface{}) middleware.Responder { + return ae.IsAllowed(r.listClientTerminators, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + //Management + ae.ManagementApi.ServiceDeleteServiceHandler = managementService.DeleteServiceHandlerFunc(func(params managementService.DeleteServiceParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceDetailServiceHandler = service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) //filter restricted + ae.ManagementApi.ServiceDetailServiceHandler = managementService.DetailServiceHandlerFunc(func(params managementService.DetailServiceParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServicesHandler = service.ListServicesHandlerFunc(func(params service.ListServicesParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAuthenticated()) //filter restricted + ae.ManagementApi.ServiceListServicesHandler = managementService.ListServicesHandlerFunc(func(params managementService.ListServicesParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.ListManagementServices, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServiceUpdateServiceHandler = service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceUpdateServiceHandler = managementService.UpdateServiceHandlerFunc(func(params managementService.UpdateServiceParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceCreateServiceHandler = service.CreateServiceHandlerFunc(func(params service.CreateServiceParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceCreateServiceHandler = managementService.CreateServiceHandlerFunc(func(params managementService.CreateServiceParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.ServicePatchServiceHandler = service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServicePatchServiceHandler = managementService.PatchServiceHandlerFunc(func(params managementService.PatchServiceParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceServiceEdgeRouterPoliciesHandler = service.ListServiceServiceEdgeRouterPoliciesHandlerFunc(func(params service.ListServiceServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceListServiceServiceEdgeRouterPoliciesHandler = managementService.ListServiceServiceEdgeRouterPoliciesHandlerFunc(func(params managementService.ListServiceServiceEdgeRouterPoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServiceEdgeRouterPolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceEdgeRoutersHandler = service.ListServiceEdgeRoutersHandlerFunc(func(params service.ListServiceEdgeRoutersParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceListServiceEdgeRoutersHandler = managementService.ListServiceEdgeRoutersHandlerFunc(func(params managementService.ListServiceEdgeRoutersParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listEdgeRouters, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceServicePoliciesHandler = service.ListServiceServicePoliciesHandlerFunc(func(params service.ListServiceServicePoliciesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceListServiceServicePoliciesHandler = managementService.ListServiceServicePoliciesHandlerFunc(func(params managementService.ListServiceServicePoliciesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listServicePolicies, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceIdentitiesHandler = service.ListServiceIdentitiesHandlerFunc(func(params service.ListServiceIdentitiesParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceListServiceIdentitiesHandler = managementService.ListServiceIdentitiesHandlerFunc(func(params managementService.ListServiceIdentitiesParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listIdentities, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceConfigHandler = service.ListServiceConfigHandlerFunc(func(params service.ListServiceConfigParams, _ interface{}) middleware.Responder { + ae.ManagementApi.ServiceListServiceConfigHandler = managementService.ListServiceConfigHandlerFunc(func(params managementService.ListServiceConfigParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.listConfigs, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.ServiceListServiceTerminatorsHandler = service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, i interface{}) middleware.Responder { - return ae.IsAllowed(r.listTerminators, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + ae.ManagementApi.ServiceListServiceTerminatorsHandler = managementService.ListServiceTerminatorsHandlerFunc(func(params managementService.ListServiceTerminatorsParams, i interface{}) middleware.Responder { + return ae.IsAllowed(r.listManagementTerminators, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } -func (r *ServiceRouter) List(ae *env.AppEnv, rc *response.RequestContext) { - start := time.Now() - // ListWithHandler won't do search limiting by logged in user +func (r *ServiceRouter) ListManagementServices(ae *env.AppEnv, rc *response.RequestContext) { + //always admin List(rc, func(rc *response.RequestContext, queryOptions *PublicQueryOptions) (*QueryResult, error) { identity := rc.Identity - if rc.Identity.IsAdmin { - if asId := rc.Request.URL.Query().Get("asIdentity"); asId != "" { - var err error - identity, err = ae.Handlers.Identity.ReadOneByQuery(fmt.Sprintf(`id = "%v" or name = "%v"`, asId, asId)) - if err != nil { - return nil, err - } - if identity == nil { - return nil, boltz.NewNotFoundError("identity", "id or name", asId) - } + if asId := rc.Request.URL.Query().Get("asIdentity"); asId != "" { + var err error + identity, err = ae.Handlers.Identity.ReadOneByQuery(fmt.Sprintf(`id = "%v" or name = "%v"`, asId, asId)) + if err != nil { + return nil, err + } + if identity == nil { + return nil, boltz.NewNotFoundError("identity", "id or name", asId) } } @@ -135,7 +148,8 @@ func (r *ServiceRouter) List(ae *env.AppEnv, rc *response.RequestContext) { var apiEntities []interface{} var qmd *models.QueryMetaData - if rc.Identity.IsAdmin && len(roleFilters) > 0 { + + if len(roleFilters) > 0 { cursorProvider, err := ae.GetStores().EdgeService.GetRoleAttributesCursorProvider(roleFilters, roleSemantic) if err != nil { return nil, err @@ -164,6 +178,40 @@ func (r *ServiceRouter) List(ae *env.AppEnv, rc *response.RequestContext) { } qmd = &result.QueryMetaData } + + + return NewQueryResult(apiEntities, qmd), nil + }) +} + +func (r *ServiceRouter) ListClientServices(ae *env.AppEnv, rc *response.RequestContext) { + //never in an admin capacity + start := time.Now() + // ListWithHandler won't do search limiting by logged in user + List(rc, func(rc *response.RequestContext, queryOptions *PublicQueryOptions) (*QueryResult, error) { + + // allow overriding config types + configTypes := rc.ApiSession.ConfigTypes + if requestedConfigTypes := rc.Request.URL.Query().Get("configTypes"); requestedConfigTypes != "" { + configTypes = ae.Handlers.ConfigType.MapConfigTypeNamesToIds(strings.Split(requestedConfigTypes, ","), rc.Identity.Id) + } + + query, err := queryOptions.getFullQuery(ae.Handlers.EdgeService.GetStore()) + if err != nil { + return nil, err + } + + result, err := ae.Handlers.EdgeService.PublicQueryForIdentity(rc.Identity, configTypes, query) + if err != nil { + pfxlog.Logger().Errorf("error executing list query: %+v", err) + return nil, err + } + apiEntities, err := MapServicesToRestEntity(ae, rc, result.Services) + if err != nil { + return nil, err + } + qmd := &result.QueryMetaData + return NewQueryResult(apiEntities, qmd), nil }) r.listTimer.UpdateSince(start) @@ -180,7 +228,7 @@ func (r *ServiceRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { }) } -func (r *ServiceRouter) Create(ae *env.AppEnv, rc *response.RequestContext, params service.CreateServiceParams) { +func (r *ServiceRouter) Create(ae *env.AppEnv, rc *response.RequestContext, params managementService.CreateServiceParams) { Create(rc, rc, ServiceLinkFactory, func() (string, error) { return ae.Handlers.EdgeService.Create(MapCreateServiceToModel(params.Service)) }) @@ -190,13 +238,13 @@ func (r *ServiceRouter) Delete(ae *env.AppEnv, rc *response.RequestContext) { DeleteWithHandler(rc, ae.Handlers.EdgeService) } -func (r *ServiceRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params service.UpdateServiceParams) { +func (r *ServiceRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params managementService.UpdateServiceParams) { Update(rc, func(id string) error { return ae.Handlers.EdgeService.Update(MapUpdateServiceToModel(params.ID, params.Service)) }) } -func (r *ServiceRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, params service.PatchServiceParams) { +func (r *ServiceRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, params managementService.PatchServiceParams) { Patch(rc, func(id string, fields JsonFields) error { return ae.Handlers.EdgeService.Patch(MapPatchServiceToModel(params.ID, params.Service), fields.ConcatNestedNames().FilterMaps("tags")) }) @@ -214,37 +262,35 @@ func (r *ServiceRouter) listConfigs(ae *env.AppEnv, rc *response.RequestContext) r.listAssociations(ae, rc, ae.Handlers.Config, MapConfigToRestEntity) } -func (r *ServiceRouter) listTerminators(ae *env.AppEnv, rc *response.RequestContext) { - if rc.Identity.IsAdmin { - r.listAssociations(ae, rc, ae.Handlers.Terminator, MapTerminatorToRestEntity) - return - } else { - serviceId, err := rc.GetEntityId() +func (r *ServiceRouter) listManagementTerminators(ae *env.AppEnv, rc *response.RequestContext) { + r.listAssociations(ae, rc, ae.Handlers.Terminator, MapTerminatorToRestEntity) +} - if err != nil { - rc.RespondWithError(err) - return - } +func (r *ServiceRouter) listClientTerminators(ae *env.AppEnv, rc *response.RequestContext) { + serviceId, err := rc.GetEntityId() - svc, err := ae.Handlers.EdgeService.ReadForIdentity(serviceId, rc.Identity.Id, nil) - - if err != nil { - if boltz.IsErrNotFoundErr(err) { - rc.RespondWithNotFound() - } else { - rc.RespondWithError(err) - } - return - } - - if svc == nil { - rc.RespondWithNotFound() - return - } - - r.listAssociations(ae, rc, ae.Handlers.Terminator, MapLimitedTerminatorToRestEntity) + if err != nil { + rc.RespondWithError(err) return } + + svc, err := ae.Handlers.EdgeService.ReadForIdentity(serviceId, rc.Identity.Id, nil) + + if err != nil { + if boltz.IsErrNotFoundErr(err) { + rc.RespondWithNotFound() + } else { + rc.RespondWithError(err) + } + return + } + + if svc == nil { + rc.RespondWithNotFound() + return + } + + r.listAssociations(ae, rc, ae.Handlers.Terminator, MapClientTerminatorToRestEntity) } func (r *ServiceRouter) listAssociations(ae *env.AppEnv, rc *response.RequestContext, associationLoader models.EntityRetriever, mapper ModelToApiMapper) { diff --git a/controller/internal/routes/session_api_model.go b/controller/internal/routes/session_api_model.go index a18d571ff..1200daa8f 100644 --- a/controller/internal/routes/session_api_model.go +++ b/controller/internal/routes/session_api_model.go @@ -100,6 +100,8 @@ func MapSessionToRestModel(ae *env.AppEnv, sessionModel *model.Session) (*rest_m return nil, err } + dialBindType := rest_model.DialBind(sessionModel.Type) + ret := &rest_model.SessionDetail{ BaseEntity: BaseEntityToRestModel(sessionModel, SessionLinkFactory), APISession: ToEntityRef("", apiSession, ApiSessionLinkFactory), @@ -107,7 +109,7 @@ func MapSessionToRestModel(ae *env.AppEnv, sessionModel *model.Session) (*rest_m Service: ToEntityRef(service.Name, service, ServiceLinkFactory), ServiceID: &service.Id, EdgeRouters: edgeRouters, - Type: rest_model.DialBind(sessionModel.Type), + Type: &dialBindType, Token: &sessionModel.Token, } diff --git a/controller/internal/routes/session_api_responder.go b/controller/internal/routes/session_api_responder.go index 262003721..8ac491e93 100644 --- a/controller/internal/routes/session_api_responder.go +++ b/controller/internal/routes/session_api_responder.go @@ -28,7 +28,7 @@ type SessionRequestResponder struct { ae *env.AppEnv } -func (nsr *SessionRequestResponder) RespondWithCreatedId(id string, link rest_model.Link) { +func (nsr *SessionRequestResponder) RespondWithCreatedId(id string, _ rest_model.Link) { modelSession, err := nsr.ae.GetHandlers().Session.Read(id) if err != nil { nsr.RespondWithError(err) diff --git a/controller/internal/routes/session_router.go b/controller/internal/routes/session_router.go index 158293af0..92fdb0362 100644 --- a/controller/internal/routes/session_router.go +++ b/controller/internal/routes/session_router.go @@ -21,8 +21,10 @@ import ( "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/edge/rest_server/operations/session" "github.com/openziti/foundation/metrics" "time" ) @@ -46,25 +48,41 @@ func NewSessionRouter() *SessionRouter { func (r *SessionRouter) Register(ae *env.AppEnv) { r.createTimer = ae.GetHostController().GetNetwork().GetMetricsRegistry().Timer("session.create") - ae.Api.SessionDeleteSessionHandler = session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, _ interface{}) middleware.Responder { + + //Management + ae.ManagementApi.SessionDeleteSessionHandler = managementSession.DeleteSessionHandlerFunc(func(params managementSession.DeleteSessionParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) - ae.Api.SessionDetailSessionHandler = session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, _ interface{}) middleware.Responder { + ae.ManagementApi.SessionDetailSessionHandler = managementSession.DetailSessionHandlerFunc(func(params managementSession.DetailSessionParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) }) - ae.Api.SessionListSessionsHandler = session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.SessionListSessionsHandler = managementSession.ListSessionsHandlerFunc(func(params managementSession.ListSessionsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.SessionCreateSessionHandler = session.CreateSessionHandlerFunc(func(params session.CreateSessionParams, _ interface{}) middleware.Responder { + ae.ManagementApi.SessionDetailSessionRoutePathHandler = managementSession.DetailSessionRoutePathHandlerFunc(func(params managementSession.DetailSessionRoutePathParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.DetailRoutePath(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + //Client + ae.ClientApi.SessionDeleteSessionHandler = clientSession.DeleteSessionHandlerFunc(func(params clientSession.DeleteSessionParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + ae.ClientApi.SessionDetailSessionHandler = clientSession.DetailSessionHandlerFunc(func(params clientSession.DetailSessionParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAuthenticated()) + }) + + ae.ClientApi.SessionListSessionsHandler = clientSession.ListSessionsHandlerFunc(func(params clientSession.ListSessionsParams, _ interface{}) middleware.Responder { + return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAuthenticated()) + }) + + ae.ClientApi.SessionCreateSessionHandler = clientSession.CreateSessionHandlerFunc(func(params clientSession.CreateSessionParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) }) - ae.Api.SessionDetailSessionRoutePathHandler = session.DetailSessionRoutePathHandlerFunc(func(params session.DetailSessionRoutePathParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.DetailRoutePath(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAuthenticated()) - }) } func (r *SessionRouter) List(ae *env.AppEnv, rc *response.RequestContext) { @@ -113,7 +131,7 @@ func (r *SessionRouter) Create(ae *env.AppEnv, rc *response.RequestContext, para r.createTimer.UpdateSince(start) } -func (r *SessionRouter) DetailRoutePath(ae *env.AppEnv, rc *response.RequestContext, params session.DetailSessionRoutePathParams) { +func (r *SessionRouter) DetailRoutePath(ae *env.AppEnv, rc *response.RequestContext, params managementSession.DetailSessionRoutePathParams) { path := []string{} //must be non null for _, fabricSession := range ae.HostController.GetNetwork().GetAllSessions() { diff --git a/controller/internal/routes/spec_router.go b/controller/internal/routes/spec_router.go index 161c2b42c..633b3f2cf 100644 --- a/controller/internal/routes/spec_router.go +++ b/controller/internal/routes/spec_router.go @@ -25,9 +25,11 @@ import ( "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/edge/rest_server" - "github.com/openziti/edge/rest_server/operations/informational" "github.com/openziti/fabric/controller/models" "time" ) @@ -59,7 +61,8 @@ type Spec struct { body map[string]interface{} } -var swaggerSpec *Spec +var clientSpec *Spec +var managementSpec *Spec var specs []*Spec func init() { @@ -72,22 +75,38 @@ func init() { pfxlog.Logger().WithError(err).Warn("could not parse build info date for swagger spec") } } - swaggerSpec = &Spec{ + + clientSpec = &Spec{ BaseEntity: models.BaseEntity{ - Id: "swagger", + Id: "edge-client", CreatedAt: date, UpdatedAt: date, Tags: map[string]interface{}{}, }, - name: "swagger", + name: "edge-client", } - err := json.Unmarshal(rest_server.SwaggerJSON, &swaggerSpec.body) + managementSpec = &Spec{ + BaseEntity: models.BaseEntity{ + Id: "edge-management", + CreatedAt: date, + UpdatedAt: date, + Tags: map[string]interface{}{}, + }, + name: "edge-management", + } + + err := json.Unmarshal(rest_client_api_server.SwaggerJSON, &clientSpec.body) if err != nil { - pfxlog.Logger().WithError(err).Panic("could not parse rest server JSON spec") + pfxlog.Logger().WithError(err).Panic("could not parse edge client server JSON spec") } - specs = append(specs, swaggerSpec) + err = json.Unmarshal(rest_management_api_server.SwaggerJSON, &managementSpec.body) + if err != nil { + pfxlog.Logger().WithError(err).Panic("could not parse edge management server JSON spec") + } + + specs = append(specs, clientSpec, managementSpec) r := NewSpecRouter() env.AddRouter(r) @@ -104,24 +123,38 @@ func NewSpecRouter() *SpecRouter { } func (r *SpecRouter) Register(ae *env.AppEnv) { - ae.Api.InformationalListSpecsHandler = informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder { + //Client + ae.ClientApi.InformationalListSpecsHandler = clientInformational.ListSpecsHandlerFunc(func(params clientInformational.ListSpecsParams) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.InformationalDetailSpecHandler = informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder { + ae.ClientApi.InformationalDetailSpecHandler = clientInformational.DetailSpecHandlerFunc(func(params clientInformational.DetailSpecParams) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.Always()) }) - ae.Api.InformationalDetailSpecBodyHandler = informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder { + ae.ClientApi.InformationalDetailSpecBodyHandler = clientInformational.DetailSpecBodyHandlerFunc(func(params clientInformational.DetailSpecBodyParams) middleware.Responder { + return ae.IsAllowed(r.DetailBody, params.HTTPRequest, params.ID, "", permissions.Always()) + }) + + //Management + ae.ManagementApi.InformationalListSpecsHandler = managementInformational.ListSpecsHandlerFunc(func(params managementInformational.ListSpecsParams) middleware.Responder { + return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.Always()) + }) + + ae.ManagementApi.InformationalDetailSpecHandler = managementInformational.DetailSpecHandlerFunc(func(params managementInformational.DetailSpecParams) middleware.Responder { + return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.Always()) + }) + + ae.ManagementApi.InformationalDetailSpecBodyHandler = managementInformational.DetailSpecBodyHandlerFunc(func(params managementInformational.DetailSpecBodyParams) middleware.Responder { return ae.IsAllowed(r.DetailBody, params.HTTPRequest, params.ID, "", permissions.Always()) }) } func (r *SpecRouter) List(_ *env.AppEnv, rc *response.RequestContext) { data := rest_model.SpecList{ - mapSpecToRestModel(swaggerSpec), + mapSpecToRestModel(clientSpec), } - + rc.RespondWithOk(data, &rest_model.Meta{}) } diff --git a/controller/internal/routes/summary_router.go b/controller/internal/routes/summary_router.go index f9f798774..6df4b574c 100644 --- a/controller/internal/routes/summary_router.go +++ b/controller/internal/routes/summary_router.go @@ -22,8 +22,8 @@ import ( "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/informational" "github.com/openziti/edge/rest_model" - "github.com/openziti/edge/rest_server/operations/informational" "go.etcd.io/bbolt" "reflect" @@ -45,7 +45,7 @@ func NewSummaryRouter() *SummaryRouter { } func (r *SummaryRouter) Register(ae *env.AppEnv) { - ae.Api.InformationalListSummaryHandler = informational.ListSummaryHandlerFunc(func(params informational.ListSummaryParams, _ interface{}) middleware.Responder { + ae.ManagementApi.InformationalListSummaryHandler = informational.ListSummaryHandlerFunc(func(params informational.ListSummaryParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) diff --git a/controller/internal/routes/terminator_api_model.go b/controller/internal/routes/terminator_api_model.go index 0f5ac4c69..1afb091dc 100644 --- a/controller/internal/routes/terminator_api_model.go +++ b/controller/internal/routes/terminator_api_model.go @@ -44,7 +44,11 @@ func MapCreateTerminatorToModel(terminator *rest_model.TerminatorCreate) *networ Identity: terminator.Identity, IdentitySecret: terminator.IdentitySecret, Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)), - Cost: uint16(terminator.Cost), + Cost: 0, + } + + if terminator.Cost != nil { + ret.Cost = uint16(*terminator.Cost) } return ret @@ -61,7 +65,7 @@ func MapUpdateTerminatorToModel(id string, terminator *rest_model.TerminatorUpda Binding: stringz.OrEmpty(terminator.Binding), Address: stringz.OrEmpty(terminator.Address), Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)), - Cost: uint16(terminator.Cost), + Cost: uint16(*terminator.Cost), } return ret } @@ -77,7 +81,7 @@ func MapPatchTerminatorToModel(id string, terminator *rest_model.TerminatorPatch Binding: terminator.Binding, Address: terminator.Address, Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)), - Cost: uint16(terminator.Cost), + Cost: uint16(*terminator.Cost), } return ret } @@ -115,6 +119,9 @@ func MapTerminatorToRestModel(ae *env.AppEnv, terminator *network.Terminator) (* return nil, err } + cost := rest_model.TerminatorCost(int64(terminator.Cost)) + dynamicCost := rest_model.TerminatorCost(xt.GlobalCosts().GetDynamicCost(terminator.Id)) + ret := &rest_model.TerminatorDetail{ BaseEntity: BaseEntityToRestModel(terminator, TerminatorLinkFactory), ServiceID: &terminator.Service, @@ -124,23 +131,26 @@ func MapTerminatorToRestModel(ae *env.AppEnv, terminator *network.Terminator) (* Binding: &terminator.Binding, Address: &terminator.Address, Identity: &terminator.Identity, - Cost: rest_model.TerminatorCost(int64(terminator.Cost)), - DynamicCost: rest_model.TerminatorCost(xt.GlobalCosts().GetDynamicCost(terminator.Id)), + Cost: &cost, + DynamicCost: &dynamicCost, } precedence := terminator.Precedence + + resultPrecedence := rest_model.TerminatorPrecedenceDefault + if precedence.IsRequired() { - ret.Precedence = "required" + resultPrecedence = rest_model.TerminatorPrecedenceRequired } else if precedence.IsFailed() { - ret.Precedence = "failed" - } else { - ret.Precedence = "default" + resultPrecedence = rest_model.TerminatorPrecedenceFailed } + ret.Precedence = &resultPrecedence + return ret, nil } -func MapLimitedTerminatorToRestEntity(ae *env.AppEnv, _ *response.RequestContext, e models.Entity) (interface{}, error) { +func MapClientTerminatorToRestEntity(ae *env.AppEnv, _ *response.RequestContext, e models.Entity) (interface{}, error) { terminator, ok := e.(*network.Terminator) if !ok { @@ -161,13 +171,13 @@ func MapLimitedTerminatorToRestEntity(ae *env.AppEnv, _ *response.RequestContext return restModel, nil } -func MapLimitedTerminatorToRestModel(ae *env.AppEnv, terminator *network.Terminator) (*rest_model.TerminatorDetailLimited, error) { +func MapLimitedTerminatorToRestModel(ae *env.AppEnv, terminator *network.Terminator) (*rest_model.TerminatorClientDetail, error) { service, err := ae.Handlers.EdgeService.Read(terminator.Service) if err != nil { return nil, err } - ret := &rest_model.TerminatorDetailLimited{ + ret := &rest_model.TerminatorClientDetail{ BaseEntity: BaseEntityToRestModel(terminator, TerminatorLinkFactory), ServiceID: &terminator.Service, Service: ToEntityRef(service.Name, service, ServiceLinkFactory), diff --git a/controller/internal/routes/terminator_router.go b/controller/internal/routes/terminator_router.go index 6350aedf9..56edea549 100644 --- a/controller/internal/routes/terminator_router.go +++ b/controller/internal/routes/terminator_router.go @@ -21,7 +21,7 @@ import ( "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/terminator" + "github.com/openziti/edge/rest_management_api_server/operations/terminator" ) func init() { @@ -40,27 +40,27 @@ func NewTerminatorRouter() *TerminatorRouter { } func (r *TerminatorRouter) Register(ae *env.AppEnv) { - ae.Api.TerminatorDeleteTerminatorHandler = terminator.DeleteTerminatorHandlerFunc(func(params terminator.DeleteTerminatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorDeleteTerminatorHandler = terminator.DeleteTerminatorHandlerFunc(func(params terminator.DeleteTerminatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.TerminatorDetailTerminatorHandler = terminator.DetailTerminatorHandlerFunc(func(params terminator.DetailTerminatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorDetailTerminatorHandler = terminator.DetailTerminatorHandlerFunc(func(params terminator.DetailTerminatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.TerminatorListTerminatorsHandler = terminator.ListTerminatorsHandlerFunc(func(params terminator.ListTerminatorsParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorListTerminatorsHandler = terminator.ListTerminatorsHandlerFunc(func(params terminator.ListTerminatorsParams, _ interface{}) middleware.Responder { return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.TerminatorUpdateTerminatorHandler = terminator.UpdateTerminatorHandlerFunc(func(params terminator.UpdateTerminatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorUpdateTerminatorHandler = terminator.UpdateTerminatorHandlerFunc(func(params terminator.UpdateTerminatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) - ae.Api.TerminatorCreateTerminatorHandler = terminator.CreateTerminatorHandlerFunc(func(params terminator.CreateTerminatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorCreateTerminatorHandler = terminator.CreateTerminatorHandlerFunc(func(params terminator.CreateTerminatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) }) - ae.Api.TerminatorPatchTerminatorHandler = terminator.PatchTerminatorHandlerFunc(func(params terminator.PatchTerminatorParams, _ interface{}) middleware.Responder { + ae.ManagementApi.TerminatorPatchTerminatorHandler = terminator.PatchTerminatorHandlerFunc(func(params terminator.PatchTerminatorParams, _ interface{}) middleware.Responder { return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) }) } diff --git a/controller/internal/routes/transit_router_router.go b/controller/internal/routes/transit_router_router.go deleted file mode 100644 index c2e60ceab..000000000 --- a/controller/internal/routes/transit_router_router.go +++ /dev/null @@ -1,96 +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 routes - -import ( - "github.com/go-openapi/runtime/middleware" - "github.com/openziti/edge/controller/env" - "github.com/openziti/edge/controller/internal/permissions" - "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_server/operations/transit_router" -) - -func init() { - r := NewTransitRouterRouter() - env.AddRouter(r) -} - -type TransitRouterRouter struct { - BasePath string -} - -func NewTransitRouterRouter() *TransitRouterRouter { - return &TransitRouterRouter{ - BasePath: "/" + EntityNameTransitRouter, - } -} - -func (r *TransitRouterRouter) Register(ae *env.AppEnv) { - ae.Api.TransitRouterDeleteTransitRouterHandler = transit_router.DeleteTransitRouterHandlerFunc(func(params transit_router.DeleteTransitRouterParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.Delete, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) - }) - - ae.Api.TransitRouterDetailTransitRouterHandler = transit_router.DetailTransitRouterHandlerFunc(func(params transit_router.DetailTransitRouterParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.Detail, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) - }) - - ae.Api.TransitRouterListTransitRoutersHandler = transit_router.ListTransitRoutersHandlerFunc(func(params transit_router.ListTransitRoutersParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(r.List, params.HTTPRequest, "", "", permissions.IsAdmin()) - }) - - ae.Api.TransitRouterUpdateTransitRouterHandler = transit_router.UpdateTransitRouterHandlerFunc(func(params transit_router.UpdateTransitRouterParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Update(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) - }) - - ae.Api.TransitRouterCreateTransitRouterHandler = transit_router.CreateTransitRouterHandlerFunc(func(params transit_router.CreateTransitRouterParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Create(ae, rc, params) }, params.HTTPRequest, "", "", permissions.IsAdmin()) - }) - - ae.Api.TransitRouterPatchTransitRouterHandler = transit_router.PatchTransitRouterHandlerFunc(func(params transit_router.PatchTransitRouterParams, _ interface{}) middleware.Responder { - return ae.IsAllowed(func(ae *env.AppEnv, rc *response.RequestContext) { r.Patch(ae, rc, params) }, params.HTTPRequest, params.ID, "", permissions.IsAdmin()) - }) -} - -func (r *TransitRouterRouter) List(ae *env.AppEnv, rc *response.RequestContext) { - ListWithHandler(ae, rc, ae.Handlers.TransitRouter, MapTransitRouterToRestEntity) -} - -func (r *TransitRouterRouter) Detail(ae *env.AppEnv, rc *response.RequestContext) { - DetailWithHandler(ae, rc, ae.Handlers.TransitRouter, MapTransitRouterToRestEntity) -} - -func (r *TransitRouterRouter) Create(ae *env.AppEnv, rc *response.RequestContext, params transit_router.CreateTransitRouterParams) { - Create(rc, rc, TransitRouterLinkFactory, func() (string, error) { - return ae.Handlers.TransitRouter.Create(MapCreateTransitRouterToModel(params.Router)) - }) -} - -func (r *TransitRouterRouter) Delete(ae *env.AppEnv, rc *response.RequestContext) { - DeleteWithHandler(rc, ae.Handlers.TransitRouter) -} - -func (r *TransitRouterRouter) Update(ae *env.AppEnv, rc *response.RequestContext, params transit_router.UpdateTransitRouterParams) { - Update(rc, func(id string) error { - return ae.Handlers.TransitRouter.Update(MapUpdateTransitRouterToModel(params.ID, params.Router), false) - }) -} - -func (r *TransitRouterRouter) Patch(ae *env.AppEnv, rc *response.RequestContext, params transit_router.PatchTransitRouterParams) { - Patch(rc, func(id string, fields JsonFields) error { - return ae.Handlers.TransitRouter.Patch(MapPatchTransitRouterToModel(params.ID, params.Router), fields.ConcatNestedNames().FilterMaps("tags"), false) - }) -} diff --git a/controller/internal/routes/version_router.go b/controller/internal/routes/version_router.go index be5321463..a6820798e 100644 --- a/controller/internal/routes/version_router.go +++ b/controller/internal/routes/version_router.go @@ -23,8 +23,9 @@ import ( "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/edge/rest_server/operations/informational" "runtime" ) @@ -44,11 +45,19 @@ func NewVersionRouter() *VersionRouter { } func (ir *VersionRouter) Register(ae *env.AppEnv) { - ae.Api.InformationalListVersionHandler = informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder { + ae.ClientApi.InformationalListVersionHandler = clientInformational.ListVersionHandlerFunc(func(params clientInformational.ListVersionParams) middleware.Responder { return ae.IsAllowed(ir.List, params.HTTPRequest, "", "", permissions.Always()) }) - ae.Api.InformationalListRootHandler = informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder { + ae.ClientApi.InformationalListRootHandler = clientInformational.ListRootHandlerFunc(func(params clientInformational.ListRootParams) middleware.Responder { + return ae.IsAllowed(ir.List, params.HTTPRequest, "", "", permissions.Always()) + }) + + ae.ManagementApi.InformationalListVersionHandler = managementInformational.ListVersionHandlerFunc(func(params managementInformational.ListVersionParams) middleware.Responder { + return ae.IsAllowed(ir.List, params.HTTPRequest, "", "", permissions.Always()) + }) + + ae.ManagementApi.InformationalListRootHandler = managementInformational.ListRootHandlerFunc(func(params managementInformational.ListRootParams) middleware.Responder { return ae.IsAllowed(ir.List, params.HTTPRequest, "", "", permissions.Always()) }) } @@ -61,7 +70,7 @@ func (ir *VersionRouter) List(_ *env.AppEnv, rc *response.RequestContext) { RuntimeVersion: runtime.Version(), Version: buildInfo.Version(), APIVersions: map[string]map[string]rest_model.APIVersion{ - "edge": {controller.RestApiV1: mapApiVersionToRestModel(controller.RestApiBaseUrlV1)}, + "edge": {controller.RestApiV1: mapApiVersionToRestModel(controller.LegacyClientRestApiBaseUrlV1)}, }, } rc.RespondWithOk(data, &rest_model.Meta{}) diff --git a/controller/server/controller.go b/controller/server/controller.go index 240a22406..836139410 100644 --- a/controller/server/controller.go +++ b/controller/server/controller.go @@ -26,7 +26,8 @@ import ( sync2 "github.com/openziti/edge/controller/sync_strats" "github.com/openziti/edge/controller/timeout" "github.com/openziti/edge/pb/edge_ctrl_pb" - "github.com/openziti/edge/rest_server" + "github.com/openziti/edge/rest_client_api_server" + "github.com/openziti/edge/rest_management_api_server" "net/http" "strings" "sync" @@ -270,8 +271,29 @@ func (c *Controller) Run() { http.MethodDelete}), handlers.AllowCredentials(), } - c.AppEnv.Api.Context() - apiHandler := c.AppEnv.Api.Serve(func(handler http.Handler) http.Handler { + c.AppEnv.ManagementApi.Context() + c.AppEnv.ClientApi.Context() + + clientApiHandler := c.AppEnv.ClientApi.Serve(func(handler http.Handler) http.Handler { + return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + rc := c.AppEnv.CreateRequestContext(rw, r) + + env.AddRequestContextToHttpContext(r, rc) + + err := c.AppEnv.FillRequestContext(rc) + if err != nil { + rc.RespondWithError(err) + return + } + + //after request context is filled so that api session is present for session expiration headers + response.AddHeaders(rc) + + handler.ServeHTTP(rw, r) + }) + }) + + managementApiHandler := c.AppEnv.ManagementApi.Serve(func(handler http.Handler) http.Handler { return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { rc := c.AppEnv.CreateRequestContext(rw, r) @@ -292,19 +314,40 @@ func (c *Controller) Run() { handler := http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { writer.Header().Set(ZitiInstanceId, c.AppEnv.InstanceId) - //if not edge prefix, translate to "/edge/v" - if !strings.HasPrefix(request.URL.Path, controller.RestApiBase) { - request.URL.Path = controller.RestApiBaseUrlLatest + request.URL.Path + + //if not /edge prefix, translate to "/edge/client/v" + if !strings.HasPrefix(request.URL.Path, controller.RestApiRootPath) { + request.URL.Path = controller.ClientRestApiBaseUrlLatest + request.URL.Path } - if request.URL.Path == controller.RestApiSpecUrl { + //translate /edge/v1 to /edge/client/v1 + request.URL.Path = strings.Replace(request.URL.Path, controller.LegacyClientRestApiBaseUrlV1, controller.ClientRestApiBaseUrlLatest, 1) + + if request.URL.Path == controller.ClientRestApiSpecUrl { writer.Header().Set("content-type", "application/json") writer.WriteHeader(http.StatusOK) - _, _ = writer.Write(rest_server.SwaggerJSON) + _, _ = writer.Write(rest_client_api_server.SwaggerJSON) return } - //let the OpenApi http router take over - apiHandler.ServeHTTP(writer, request) + + if request.URL.Path == controller.ManagementRestApiSpecUrl { + writer.Header().Set("content-type", "application/json") + writer.WriteHeader(http.StatusOK) + _, _ = writer.Write(rest_management_api_server.SwaggerJSON) + return + } + + if strings.HasPrefix(request.URL.Path, controller.ManagementRestApiBaseUrlLatest) { + managementApiHandler.ServeHTTP(writer, request) + return + } + + if strings.HasPrefix(request.URL.Path, controller.ClientRestApiBase) { + clientApiHandler.ServeHTTP(writer, request) + return + } + + pfxlog.Logger().Debugf("unhandled request URL: %s", request.URL.Path) }) timeoutHandler := timeout.TimeoutHandler(handler, 10*time.Second, apierror.NewTimeoutError()) diff --git a/controller/versions.go b/controller/versions.go index 62842d43d..9c71075ad 100644 --- a/controller/versions.go +++ b/controller/versions.go @@ -17,10 +17,20 @@ package controller const ( - RestApiBase = "/edge/" + RestApiV1 = "/v1" + + RestApiRootPath = "/edge" + ClientRestApiBase = "/edge/client" + ManagementRestApiBase = "/edge/management" + + LegacyClientRestApiBaseUrlV1 = RestApiRootPath + RestApiV1 + ClientRestApiBaseUrlV1 = ClientRestApiBase + RestApiV1 + ManagementRestApiBaseUrlV1 = ManagementRestApiBase + RestApiV1 + + ClientRestApiBaseUrlLatest = ClientRestApiBaseUrlV1 + ManagementRestApiBaseUrlLatest = ManagementRestApiBaseUrlV1 + + ClientRestApiSpecUrl = ClientRestApiBaseUrlLatest + "/swagger.json" + ManagementRestApiSpecUrl = ManagementRestApiBaseUrlLatest + "/swagger.json" - RestApiV1 = "v1" - RestApiBaseUrlV1 = "/edge/" + RestApiV1 - RestApiBaseUrlLatest = RestApiBaseUrlV1 - RestApiSpecUrl = RestApiBaseUrlLatest + "/swagger.json" ) diff --git a/go.mod b/go.mod index 925238f34..80693ef23 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/netfoundry/secretstream v0.1.2 github.com/openziti/fabric v0.16.59 github.com/openziti/foundation v0.15.50 - github.com/openziti/sdk-golang v0.15.45 + github.com/openziti/sdk-golang v0.15.47 github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 diff --git a/go.sum b/go.sum index a005c538d..869e7fc9a 100644 --- a/go.sum +++ b/go.sum @@ -491,8 +491,8 @@ github.com/openziti/fabric v0.16.59 h1:PQlCooOM0sK9Afo0EwuBJlNphASwfTPKAde8LlxAy github.com/openziti/fabric v0.16.59/go.mod h1:xro2eGr6ilDmz8qZ0sp7KjHMl0KU4l9aOBydGF/tg9E= github.com/openziti/foundation v0.15.50 h1:xvID5CAXNLAb0h9nOXCQr4PlcxlPpnPOnNDoEeyl424= github.com/openziti/foundation v0.15.50/go.mod h1:NnSBTp9ZkcYsv6nYxZR0/NzoHfkIo6tjpBHDvBsPFqw= -github.com/openziti/sdk-golang v0.15.45 h1:SaO4puquArrZp+gk0Ub41j8VO40pUH0cwYyyvJXCo6k= -github.com/openziti/sdk-golang v0.15.45/go.mod h1:T68tkxqOwwcZhzfRjxSK26xe0eWsQ3VeLqi3cLCzQ0M= +github.com/openziti/sdk-golang v0.15.47 h1:6/VUergS4cWcmz4xAn45Q/aTC99steFWsLs3TLdk2Rk= +github.com/openziti/sdk-golang v0.15.47/go.mod h1:T68tkxqOwwcZhzfRjxSK26xe0eWsQ3VeLqi3cLCzQ0M= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 h1:fa50YL1pzKW+1SsBnJDOHppJN9stOEwS+CRWyUtyYGU= github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= diff --git a/rest_client/geo_region/detail_geo_region_parameters.go b/rest_client/geo_region/detail_geo_region_parameters.go deleted file mode 100644 index 907b274f1..000000000 --- a/rest_client/geo_region/detail_geo_region_parameters.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package geo_region - -// 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" -) - -// NewDetailGeoRegionParams creates a new DetailGeoRegionParams object -// with the default values initialized. -func NewDetailGeoRegionParams() *DetailGeoRegionParams { - var () - return &DetailGeoRegionParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDetailGeoRegionParamsWithTimeout creates a new DetailGeoRegionParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDetailGeoRegionParamsWithTimeout(timeout time.Duration) *DetailGeoRegionParams { - var () - return &DetailGeoRegionParams{ - - timeout: timeout, - } -} - -// NewDetailGeoRegionParamsWithContext creates a new DetailGeoRegionParams object -// with the default values initialized, and the ability to set a context for a request -func NewDetailGeoRegionParamsWithContext(ctx context.Context) *DetailGeoRegionParams { - var () - return &DetailGeoRegionParams{ - - Context: ctx, - } -} - -// NewDetailGeoRegionParamsWithHTTPClient creates a new DetailGeoRegionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDetailGeoRegionParamsWithHTTPClient(client *http.Client) *DetailGeoRegionParams { - var () - return &DetailGeoRegionParams{ - HTTPClient: client, - } -} - -/*DetailGeoRegionParams contains all the parameters to send to the API endpoint -for the detail geo region operation typically these are written to a http.Request -*/ -type DetailGeoRegionParams struct { - - /*ID - The id of the requested resource - - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the detail geo region params -func (o *DetailGeoRegionParams) WithTimeout(timeout time.Duration) *DetailGeoRegionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail geo region params -func (o *DetailGeoRegionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail geo region params -func (o *DetailGeoRegionParams) WithContext(ctx context.Context) *DetailGeoRegionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail geo region params -func (o *DetailGeoRegionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail geo region params -func (o *DetailGeoRegionParams) WithHTTPClient(client *http.Client) *DetailGeoRegionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail geo region params -func (o *DetailGeoRegionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail geo region params -func (o *DetailGeoRegionParams) WithID(id string) *DetailGeoRegionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail geo region params -func (o *DetailGeoRegionParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailGeoRegionParams) 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/geo_region/detail_geo_region_responses.go b/rest_client/geo_region/detail_geo_region_responses.go deleted file mode 100644 index 8bdad7b60..000000000 --- a/rest_client/geo_region/detail_geo_region_responses.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 geo_region - -// 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" -) - -// DetailGeoRegionReader is a Reader for the DetailGeoRegion structure. -type DetailGeoRegionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailGeoRegionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailGeoRegionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailGeoRegionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailGeoRegionNotFound() - 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()) - } -} - -// NewDetailGeoRegionOK creates a DetailGeoRegionOK with default headers values -func NewDetailGeoRegionOK() *DetailGeoRegionOK { - return &DetailGeoRegionOK{} -} - -/*DetailGeoRegionOK handles this case with default header values. - -A single geo-region -*/ -type DetailGeoRegionOK struct { - Payload *rest_model.DetailGeoRegionEnvelope -} - -func (o *DetailGeoRegionOK) Error() string { - return fmt.Sprintf("[GET /geo-regions/{id}][%d] detailGeoRegionOK %+v", 200, o.Payload) -} - -func (o *DetailGeoRegionOK) GetPayload() *rest_model.DetailGeoRegionEnvelope { - return o.Payload -} - -func (o *DetailGeoRegionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailGeoRegionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailGeoRegionUnauthorized creates a DetailGeoRegionUnauthorized with default headers values -func NewDetailGeoRegionUnauthorized() *DetailGeoRegionUnauthorized { - return &DetailGeoRegionUnauthorized{} -} - -/*DetailGeoRegionUnauthorized handles this case with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailGeoRegionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailGeoRegionUnauthorized) Error() string { - return fmt.Sprintf("[GET /geo-regions/{id}][%d] detailGeoRegionUnauthorized %+v", 401, o.Payload) -} - -func (o *DetailGeoRegionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailGeoRegionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailGeoRegionNotFound creates a DetailGeoRegionNotFound with default headers values -func NewDetailGeoRegionNotFound() *DetailGeoRegionNotFound { - return &DetailGeoRegionNotFound{} -} - -/*DetailGeoRegionNotFound handles this case with default header values. - -The requested resource does not exist -*/ -type DetailGeoRegionNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailGeoRegionNotFound) Error() string { - return fmt.Sprintf("[GET /geo-regions/{id}][%d] detailGeoRegionNotFound %+v", 404, o.Payload) -} - -func (o *DetailGeoRegionNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailGeoRegionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.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/geo_region/list_geo_regions_parameters.go b/rest_client/geo_region/list_geo_regions_parameters.go deleted file mode 100644 index 30d6441f6..000000000 --- a/rest_client/geo_region/list_geo_regions_parameters.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 geo_region - -// 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" -) - -// NewListGeoRegionsParams creates a new ListGeoRegionsParams object -// with the default values initialized. -func NewListGeoRegionsParams() *ListGeoRegionsParams { - var () - return &ListGeoRegionsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListGeoRegionsParamsWithTimeout creates a new ListGeoRegionsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListGeoRegionsParamsWithTimeout(timeout time.Duration) *ListGeoRegionsParams { - var () - return &ListGeoRegionsParams{ - - timeout: timeout, - } -} - -// NewListGeoRegionsParamsWithContext creates a new ListGeoRegionsParams object -// with the default values initialized, and the ability to set a context for a request -func NewListGeoRegionsParamsWithContext(ctx context.Context) *ListGeoRegionsParams { - var () - return &ListGeoRegionsParams{ - - Context: ctx, - } -} - -// NewListGeoRegionsParamsWithHTTPClient creates a new ListGeoRegionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewListGeoRegionsParamsWithHTTPClient(client *http.Client) *ListGeoRegionsParams { - var () - return &ListGeoRegionsParams{ - HTTPClient: client, - } -} - -/*ListGeoRegionsParams contains all the parameters to send to the API endpoint -for the list geo regions operation typically these are written to a http.Request -*/ -type ListGeoRegionsParams struct { - - /*Filter*/ - Filter *string - /*Limit*/ - Limit *int64 - /*Offset*/ - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the list geo regions params -func (o *ListGeoRegionsParams) WithTimeout(timeout time.Duration) *ListGeoRegionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list geo regions params -func (o *ListGeoRegionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list geo regions params -func (o *ListGeoRegionsParams) WithContext(ctx context.Context) *ListGeoRegionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list geo regions params -func (o *ListGeoRegionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list geo regions params -func (o *ListGeoRegionsParams) WithHTTPClient(client *http.Client) *ListGeoRegionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list geo regions params -func (o *ListGeoRegionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list geo regions params -func (o *ListGeoRegionsParams) WithFilter(filter *string) *ListGeoRegionsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list geo regions params -func (o *ListGeoRegionsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list geo regions params -func (o *ListGeoRegionsParams) WithLimit(limit *int64) *ListGeoRegionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list geo regions params -func (o *ListGeoRegionsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list geo regions params -func (o *ListGeoRegionsParams) WithOffset(offset *int64) *ListGeoRegionsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list geo regions params -func (o *ListGeoRegionsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListGeoRegionsParams) 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/transit_router/transit_router_client.go b/rest_client/transit_router/transit_router_client.go deleted file mode 100644 index c724e0a08..000000000 --- a/rest_client/transit_router/transit_router_client.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 transit_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 transit router API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for transit router API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - CreateTransitRouter(params *CreateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*CreateTransitRouterCreated, error) - - DeleteTransitRouter(params *DeleteTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTransitRouterOK, error) - - DetailTransitRouter(params *DetailTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DetailTransitRouterOK, error) - - ListTransitRouters(params *ListTransitRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListTransitRoutersOK, error) - - PatchTransitRouter(params *PatchTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*PatchTransitRouterOK, error) - - UpdateTransitRouter(params *UpdateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateTransitRouterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateTransitRouter creates a transit router resource - - Create a transit router resource. Requires admin access. -*/ -func (a *Client) CreateTransitRouter(params *CreateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*CreateTransitRouterCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateTransitRouterParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - -/* - DeleteTransitRouter deletes a transit router - - Delete a transit router by id. Requires admin access. -*/ -func (a *Client) DeleteTransitRouter(params *DeleteTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteTransitRouterParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - -/* - DetailTransitRouter retrieves a single transit router - - Retrieves a single transit router by id. Requires admin access. -*/ -func (a *Client) DetailTransitRouter(params *DetailTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DetailTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailTransitRouterParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - -/* - ListTransitRouters lists transit routers - - Retrieves a list of transit router resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListTransitRouters(params *ListTransitRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListTransitRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListTransitRoutersParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - -/* - PatchTransitRouter updates the supplied fields on a transit router - - Update the supplied fields on a transit router. Requires admin access. -*/ -func (a *Client) PatchTransitRouter(params *PatchTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*PatchTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchTransitRouterParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - -/* - UpdateTransitRouter updates all fields on a transit router - - Update all fields on a transit router by id. Requires admin access. -*/ -func (a *Client) UpdateTransitRouter(params *UpdateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateTransitRouterParams() - } - - result, err := a.transport.Submit(&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, - }) - 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_client/authentication/authenticate_mfa_parameters.go b/rest_client_api_client/authentication/authenticate_mfa_parameters.go similarity index 79% rename from rest_client/authentication/authenticate_mfa_parameters.go rename to rest_client_api_client/authentication/authenticate_mfa_parameters.go index c41ecbeaf..432445cd6 100644 --- a/rest_client/authentication/authenticate_mfa_parameters.go +++ b/rest_client_api_client/authentication/authenticate_mfa_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewAuthenticateMfaParams creates a new AuthenticateMfaParams object -// with the default values initialized. +// 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 { - var () return &AuthenticateMfaParams{ - timeout: cr.DefaultTimeout, } } // NewAuthenticateMfaParamsWithTimeout creates a new AuthenticateMfaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAuthenticateMfaParamsWithTimeout(timeout time.Duration) *AuthenticateMfaParams { - var () return &AuthenticateMfaParams{ - timeout: timeout, } } // NewAuthenticateMfaParamsWithContext creates a new AuthenticateMfaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAuthenticateMfaParamsWithContext(ctx context.Context) *AuthenticateMfaParams { - var () return &AuthenticateMfaParams{ - Context: ctx, } } // NewAuthenticateMfaParamsWithHTTPClient creates a new AuthenticateMfaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAuthenticateMfaParamsWithHTTPClient(client *http.Client) *AuthenticateMfaParams { - var () 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 +/* 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. + An MFA validation request */ MfaAuth *rest_model.MfaCode @@ -97,6 +96,21 @@ type AuthenticateMfaParams struct { 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) @@ -148,7 +162,6 @@ func (o *AuthenticateMfaParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if o.MfaAuth != nil { if err := r.SetBodyParam(o.MfaAuth); err != nil { return err diff --git a/rest_client/authentication/authenticate_mfa_responses.go b/rest_client_api_client/authentication/authenticate_mfa_responses.go similarity index 95% rename from rest_client/authentication/authenticate_mfa_responses.go rename to rest_client_api_client/authentication/authenticate_mfa_responses.go index 8015a9420..76942192d 100644 --- a/rest_client/authentication/authenticate_mfa_responses.go +++ b/rest_client_api_client/authentication/authenticate_mfa_responses.go @@ -59,7 +59,6 @@ func (o *AuthenticateMfaReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -70,7 +69,7 @@ func NewAuthenticateMfaOK() *AuthenticateMfaOK { return &AuthenticateMfaOK{} } -/*AuthenticateMfaOK handles this case with default header values. +/* AuthenticateMfaOK describes a response with status code 200, with default header values. Base empty response */ @@ -81,7 +80,6 @@ type AuthenticateMfaOK struct { 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 } @@ -103,7 +101,7 @@ func NewAuthenticateMfaUnauthorized() *AuthenticateMfaUnauthorized { return &AuthenticateMfaUnauthorized{} } -/*AuthenticateMfaUnauthorized handles this case with default header values. +/* AuthenticateMfaUnauthorized describes a response with status code 401, with default header values. Base empty response */ @@ -114,7 +112,6 @@ type AuthenticateMfaUnauthorized struct { 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 } diff --git a/rest_client/authentication/authenticate_parameters.go b/rest_client_api_client/authentication/authenticate_parameters.go similarity index 81% rename from rest_client/authentication/authenticate_parameters.go rename to rest_client_api_client/authentication/authenticate_parameters.go index ebced268b..c1ac770f0 100644 --- a/rest_client/authentication/authenticate_parameters.go +++ b/rest_client_api_client/authentication/authenticate_parameters.go @@ -42,53 +42,53 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewAuthenticateParams creates a new AuthenticateParams object -// with the default values initialized. +// 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 { - var () return &AuthenticateParams{ - timeout: cr.DefaultTimeout, } } // NewAuthenticateParamsWithTimeout creates a new AuthenticateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAuthenticateParamsWithTimeout(timeout time.Duration) *AuthenticateParams { - var () return &AuthenticateParams{ - timeout: timeout, } } // NewAuthenticateParamsWithContext creates a new AuthenticateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAuthenticateParamsWithContext(ctx context.Context) *AuthenticateParams { - var () return &AuthenticateParams{ - Context: ctx, } } // NewAuthenticateParamsWithHTTPClient creates a new AuthenticateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAuthenticateParamsWithHTTPClient(client *http.Client) *AuthenticateParams { - var () 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 +/* 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. Auth *rest_model.Authenticate - /*Method*/ + + // Method. Method string timeout time.Duration @@ -96,6 +96,21 @@ type AuthenticateParams struct { 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) @@ -158,7 +173,6 @@ func (o *AuthenticateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if o.Auth != nil { if err := r.SetBodyParam(o.Auth); err != nil { return err @@ -169,6 +183,7 @@ func (o *AuthenticateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. qrMethod := o.Method qMethod := qrMethod if qMethod != "" { + if err := r.SetQueryParam("method", qMethod); err != nil { return err } diff --git a/rest_client/authentication/authenticate_responses.go b/rest_client_api_client/authentication/authenticate_responses.go similarity index 94% rename from rest_client/authentication/authenticate_responses.go rename to rest_client_api_client/authentication/authenticate_responses.go index 16c225a4f..7f21110e6 100644 --- a/rest_client/authentication/authenticate_responses.go +++ b/rest_client_api_client/authentication/authenticate_responses.go @@ -65,7 +65,6 @@ func (o *AuthenticateReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -76,7 +75,7 @@ func NewAuthenticateOK() *AuthenticateOK { return &AuthenticateOK{} } -/*AuthenticateOK handles this case with default header values. +/* AuthenticateOK describes a response with status code 200, with default header values. The API session associated with the session used to issue the request */ @@ -87,7 +86,6 @@ type AuthenticateOK struct { 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 } @@ -109,7 +107,7 @@ func NewAuthenticateBadRequest() *AuthenticateBadRequest { return &AuthenticateBadRequest{} } -/*AuthenticateBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type AuthenticateBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewAuthenticateForbidden() *AuthenticateForbidden { return &AuthenticateForbidden{} } -/*AuthenticateForbidden handles this case with default header values. +/* AuthenticateForbidden describes a response with status code 403, with default header values. The authentication request could not be processed as the credentials are invalid */ @@ -153,7 +150,6 @@ type AuthenticateForbidden struct { 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 } diff --git a/rest_client/authentication/authentication_client.go b/rest_client_api_client/authentication/authentication_client.go similarity index 86% rename from rest_client/authentication/authentication_client.go rename to rest_client_api_client/authentication/authentication_client.go index ca78a434c..ad1c247d2 100644 --- a/rest_client/authentication/authentication_client.go +++ b/rest_client_api_client/authentication/authentication_client.go @@ -49,11 +49,14 @@ type Client struct { 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) (*AuthenticateOK, error) + Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) - AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter) (*AuthenticateMfaOK, error) + AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) SetTransport(transport runtime.ClientTransport) } @@ -64,13 +67,12 @@ type ClientService interface { Allows authentication Methods include "password" and "cert" */ -func (a *Client) Authenticate(params *AuthenticateParams) (*AuthenticateOK, error) { +func (a *Client) Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAuthenticateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "authenticate", Method: "POST", PathPattern: "/authenticate", @@ -81,7 +83,12 @@ func (a *Client) Authenticate(params *AuthenticateParams) (*AuthenticateOK, erro 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 } @@ -100,13 +107,12 @@ func (a *Client) Authenticate(params *AuthenticateParams) (*AuthenticateOK, erro Completes MFA authentication by submitting a MFA time based one time token or backup code. */ -func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter) (*AuthenticateMfaOK, error) { +func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAuthenticateMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "authenticateMfa", Method: "POST", PathPattern: "/authenticate/mfa", @@ -118,7 +124,12 @@ func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime 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 } diff --git a/rest_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 similarity index 79% rename from rest_client/current_api_session/create_current_api_session_certificate_parameters.go rename to rest_client_api_client/current_api_session/create_current_api_session_certificate_parameters.go index aa13813de..01ef7d7ca 100644 --- a/rest_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 @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateCurrentAPISessionCertificateParams creates a new CreateCurrentAPISessionCertificateParams object -// with the default values initialized. +// 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 { - var () return &CreateCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, } } // NewCreateCurrentAPISessionCertificateParamsWithTimeout creates a new CreateCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *CreateCurrentAPISessionCertificateParams { - var () return &CreateCurrentAPISessionCertificateParams{ - timeout: timeout, } } // NewCreateCurrentAPISessionCertificateParamsWithContext creates a new CreateCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *CreateCurrentAPISessionCertificateParams { - var () return &CreateCurrentAPISessionCertificateParams{ - Context: ctx, } } // NewCreateCurrentAPISessionCertificateParamsWithHTTPClient creates a new CreateCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *CreateCurrentAPISessionCertificateParams { - var () 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 +/* 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. + The payload describing the CSR used to create a session certificate */ SessionCertificate *rest_model.CurrentAPISessionCertificateCreate @@ -97,6 +96,21 @@ type CreateCurrentAPISessionCertificateParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateCurrentAPISessionCertificateParams) WriteToRequest(r runtime.Clie return err } var res []error - if o.SessionCertificate != nil { if err := r.SetBodyParam(o.SessionCertificate); err != nil { return err diff --git a/rest_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 similarity index 94% rename from rest_client/current_api_session/create_current_api_session_certificate_responses.go rename to rest_client_api_client/current_api_session/create_current_api_session_certificate_responses.go index 4c74bbac9..ccabee1b7 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *CreateCurrentAPISessionCertificateReader) ReadResponse(response runtime 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()) } @@ -76,7 +75,7 @@ func NewCreateCurrentAPISessionCertificateCreated() *CreateCurrentAPISessionCert return &CreateCurrentAPISessionCertificateCreated{} } -/*CreateCurrentAPISessionCertificateCreated handles this case with default header values. +/* CreateCurrentAPISessionCertificateCreated describes a response with status code 201, with default header values. A response of a create API Session certificate */ @@ -87,7 +86,6 @@ type CreateCurrentAPISessionCertificateCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateCurrentAPISessionCertificateBadRequest() *CreateCurrentAPISessionC return &CreateCurrentAPISessionCertificateBadRequest{} } -/*CreateCurrentAPISessionCertificateBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateCurrentAPISessionCertificateBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateCurrentAPISessionCertificateUnauthorized() *CreateCurrentAPISessio return &CreateCurrentAPISessionCertificateUnauthorized{} } -/*CreateCurrentAPISessionCertificateUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateCurrentAPISessionCertificateUnauthorized struct { 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 } diff --git a/rest_client/current_api_session/current_api_session_client.go b/rest_client_api_client/current_api_session/current_api_session_client.go similarity index 83% rename from rest_client/current_api_session/current_api_session_client.go rename to rest_client_api_client/current_api_session/current_api_session_client.go index 26140d0f0..21ccf3832 100644 --- a/rest_client/current_api_session/current_api_session_client.go +++ b/rest_client_api_client/current_api_session/current_api_session_client.go @@ -49,29 +49,32 @@ type Client struct { 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) (*DeleteCurrentAPISessionOK, error) + DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) - CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateCurrentAPISessionCertificateCreated, error) + CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCurrentAPISessionCertificateCreated, error) - DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionCertificateOK, error) + DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionCertificateOK, error) - DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentAPISessionCertificateOK, error) + DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentAPISessionCertificateOK, error) - DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentIdentityAuthenticatorOK, error) + DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) - GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentAPISessionOK, error) + GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) - ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentAPISessionCertificatesOK, error) + ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentAPISessionCertificatesOK, error) - ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentIdentityAuthenticatorsOK, error) + ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) - ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceUpdatesOK, error) + ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceUpdatesOK, error) - PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCurrentIdentityAuthenticatorOK, error) + PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) - UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCurrentIdentityAuthenticatorOK, error) + UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) SetTransport(transport runtime.ClientTransport) } @@ -81,13 +84,12 @@ type ClientService interface { Terminates the current API session */ -func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionOK, error) { +func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCurrentAPISessionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DeleteCurrentAPISession", Method: "DELETE", PathPattern: "/current-api-session", @@ -99,7 +101,12 @@ func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, 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 } @@ -118,13 +125,12 @@ func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, 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) (*CreateCurrentAPISessionCertificateCreated, error) { +func (a *Client) CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCurrentAPISessionCertificateCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateCurrentAPISessionCertificateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createCurrentApiSessionCertificate", Method: "POST", PathPattern: "/current-api-session/certificates", @@ -136,7 +142,12 @@ func (a *Client) CreateCurrentAPISessionCertificate(params *CreateCurrentAPISess 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 } @@ -156,13 +167,12 @@ func (a *Client) CreateCurrentAPISessionCertificate(params *CreateCurrentAPISess Delete an ephemeral certificateby id */ -func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionCertificateOK, error) { +func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionCertificateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCurrentAPISessionCertificateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteCurrentApiSessionCertificate", Method: "DELETE", PathPattern: "/current-api-session/certificates/{id}", @@ -174,7 +184,12 @@ func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISess 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 } @@ -193,13 +208,12 @@ func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISess Retrieves a single ephemeral certificate by id */ -func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentAPISessionCertificateOK, error) { +func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentAPISessionCertificateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailCurrentAPISessionCertificateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailCurrentApiSessionCertificate", Method: "GET", PathPattern: "/current-api-session/certificates/{id}", @@ -211,7 +225,12 @@ func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISess 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 } @@ -230,13 +249,12 @@ func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISess 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) (*DetailCurrentIdentityAuthenticatorOK, error) { +func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailCurrentIdentityAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailCurrentIdentityAuthenticator", Method: "GET", PathPattern: "/current-identity/authenticators/{id}", @@ -248,7 +266,12 @@ func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentit 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 } @@ -267,13 +290,12 @@ func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentit Retrieves the API session that was used to issue the current request */ -func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentAPISessionOK, error) { +func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCurrentAPISessionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCurrentAPISession", Method: "GET", PathPattern: "/current-api-session", @@ -285,7 +307,12 @@ func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authIn 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 } @@ -304,13 +331,12 @@ func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authIn 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) (*ListCurrentAPISessionCertificatesOK, error) { +func (a *Client) ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentAPISessionCertificatesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListCurrentAPISessionCertificatesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listCurrentApiSessionCertificates", Method: "GET", PathPattern: "/current-api-session/certificates", @@ -322,7 +348,12 @@ func (a *Client) ListCurrentAPISessionCertificates(params *ListCurrentAPISession 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 } @@ -341,13 +372,12 @@ func (a *Client) ListCurrentAPISessionCertificates(params *ListCurrentAPISession 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) (*ListCurrentIdentityAuthenticatorsOK, error) { +func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListCurrentIdentityAuthenticatorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listCurrentIdentityAuthenticators", Method: "GET", PathPattern: "/current-identity/authenticators", @@ -359,7 +389,12 @@ func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAu 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 } @@ -380,13 +415,12 @@ func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAu service refreshes. */ -func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceUpdatesOK, error) { +func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceUpdatesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceUpdatesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceUpdates", Method: "GET", PathPattern: "/current-api-session/service-updates", @@ -398,7 +432,12 @@ func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo r 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 } @@ -419,13 +458,12 @@ func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo r session's identity. */ -func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCurrentIdentityAuthenticatorOK, error) { +func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchCurrentIdentityAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchCurrentIdentityAuthenticator", Method: "PATCH", PathPattern: "/current-identity/authenticators/{id}", @@ -437,7 +475,12 @@ func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityA 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 } @@ -458,13 +501,12 @@ func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityA identity. */ -func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCurrentIdentityAuthenticatorOK, error) { +func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateCurrentIdentityAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateCurrentIdentityAuthenticator", Method: "PUT", PathPattern: "/current-identity/authenticators/{id}", @@ -476,7 +518,12 @@ func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentit 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/current_api_session/delete_current_api_session_certificate_parameters.go rename to rest_client_api_client/current_api_session/delete_current_api_session_certificate_parameters.go index 502f700ce..4018b35fb 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCurrentAPISessionCertificateParams creates a new DeleteCurrentAPISessionCertificateParams object -// with the default values initialized. +// 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 { - var () return &DeleteCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteCurrentAPISessionCertificateParamsWithTimeout creates a new DeleteCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *DeleteCurrentAPISessionCertificateParams { - var () return &DeleteCurrentAPISessionCertificateParams{ - timeout: timeout, } } // NewDeleteCurrentAPISessionCertificateParamsWithContext creates a new DeleteCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *DeleteCurrentAPISessionCertificateParams { - var () return &DeleteCurrentAPISessionCertificateParams{ - Context: ctx, } } // NewDeleteCurrentAPISessionCertificateParamsWithHTTPClient creates a new DeleteCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *DeleteCurrentAPISessionCertificateParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteCurrentAPISessionCertificateParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/current_api_session/delete_current_api_session_certificate_responses.go rename to rest_client_api_client/current_api_session/delete_current_api_session_certificate_responses.go index 37ae53350..6d7037673 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *DeleteCurrentAPISessionCertificateReader) ReadResponse(response runtime 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()) } @@ -76,7 +75,7 @@ func NewDeleteCurrentAPISessionCertificateOK() *DeleteCurrentAPISessionCertifica return &DeleteCurrentAPISessionCertificateOK{} } -/*DeleteCurrentAPISessionCertificateOK handles this case with default header values. +/* DeleteCurrentAPISessionCertificateOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeleteCurrentAPISessionCertificateOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteCurrentAPISessionCertificateBadRequest() *DeleteCurrentAPISessionC return &DeleteCurrentAPISessionCertificateBadRequest{} } -/*DeleteCurrentAPISessionCertificateBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteCurrentAPISessionCertificateBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteCurrentAPISessionCertificateUnauthorized() *DeleteCurrentAPISessio return &DeleteCurrentAPISessionCertificateUnauthorized{} } -/*DeleteCurrentAPISessionCertificateUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type DeleteCurrentAPISessionCertificateUnauthorized struct { 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 } diff --git a/rest_client/current_api_session/delete_current_api_session_parameters.go b/rest_client_api_client/current_api_session/delete_current_api_session_parameters.go similarity index 77% rename from rest_client/current_api_session/delete_current_api_session_parameters.go rename to rest_client_api_client/current_api_session/delete_current_api_session_parameters.go index 8e8164bb8..5c4951b9c 100644 --- a/rest_client/current_api_session/delete_current_api_session_parameters.go +++ b/rest_client_api_client/current_api_session/delete_current_api_session_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type DeleteCurrentAPISessionParams struct { 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) diff --git a/rest_client/current_api_session/delete_current_api_session_responses.go b/rest_client_api_client/current_api_session/delete_current_api_session_responses.go similarity index 95% rename from rest_client/current_api_session/delete_current_api_session_responses.go rename to rest_client_api_client/current_api_session/delete_current_api_session_responses.go index e628a8591..d9b7736ac 100644 --- a/rest_client/current_api_session/delete_current_api_session_responses.go +++ b/rest_client_api_client/current_api_session/delete_current_api_session_responses.go @@ -59,7 +59,6 @@ func (o *DeleteCurrentAPISessionReader) ReadResponse(response runtime.ClientResp 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()) } @@ -70,7 +69,7 @@ func NewDeleteCurrentAPISessionOK() *DeleteCurrentAPISessionOK { return &DeleteCurrentAPISessionOK{} } -/*DeleteCurrentAPISessionOK handles this case with default header values. +/* DeleteCurrentAPISessionOK describes a response with status code 200, with default header values. Base empty response */ @@ -81,7 +80,6 @@ type DeleteCurrentAPISessionOK struct { 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 } @@ -103,7 +101,7 @@ func NewDeleteCurrentAPISessionUnauthorized() *DeleteCurrentAPISessionUnauthoriz return &DeleteCurrentAPISessionUnauthorized{} } -/*DeleteCurrentAPISessionUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type DeleteCurrentAPISessionUnauthorized struct { 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/current_api_session/detail_current_api_session_certificate_parameters.go rename to rest_client_api_client/current_api_session/detail_current_api_session_certificate_parameters.go index 90dfbf480..b5e176bd3 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailCurrentAPISessionCertificateParams creates a new DetailCurrentAPISessionCertificateParams object -// with the default values initialized. +// 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 { - var () return &DetailCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, } } // NewDetailCurrentAPISessionCertificateParamsWithTimeout creates a new DetailCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *DetailCurrentAPISessionCertificateParams { - var () return &DetailCurrentAPISessionCertificateParams{ - timeout: timeout, } } // NewDetailCurrentAPISessionCertificateParamsWithContext creates a new DetailCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *DetailCurrentAPISessionCertificateParams { - var () return &DetailCurrentAPISessionCertificateParams{ - Context: ctx, } } // NewDetailCurrentAPISessionCertificateParamsWithHTTPClient creates a new DetailCurrentAPISessionCertificateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *DetailCurrentAPISessionCertificateParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailCurrentAPISessionCertificateParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/current_api_session/detail_current_api_session_certificate_responses.go rename to rest_client_api_client/current_api_session/detail_current_api_session_certificate_responses.go index 0a6abff71..39a314922 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *DetailCurrentAPISessionCertificateReader) ReadResponse(response runtime 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()) } @@ -76,7 +75,7 @@ func NewDetailCurrentAPISessionCertificateOK() *DetailCurrentAPISessionCertifica return &DetailCurrentAPISessionCertificateOK{} } -/*DetailCurrentAPISessionCertificateOK handles this case with default header values. +/* DetailCurrentAPISessionCertificateOK describes a response with status code 200, with default header values. A response containing a single API Session certificate */ @@ -87,7 +86,6 @@ type DetailCurrentAPISessionCertificateOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailCurrentAPISessionCertificateUnauthorized() *DetailCurrentAPISessio return &DetailCurrentAPISessionCertificateUnauthorized{} } -/*DetailCurrentAPISessionCertificateUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailCurrentAPISessionCertificateUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailCurrentAPISessionCertificateNotFound() *DetailCurrentAPISessionCer return &DetailCurrentAPISessionCertificateNotFound{} } -/*DetailCurrentAPISessionCertificateNotFound handles this case with default header values. +/* DetailCurrentAPISessionCertificateNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailCurrentAPISessionCertificateNotFound struct { 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 } diff --git a/rest_client/current_api_session/detail_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go similarity index 78% rename from rest_client/current_api_session/detail_current_identity_authenticator_parameters.go rename to rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go index 1bc27a64f..f2ff1d6a8 100644 --- a/rest_client/current_api_session/detail_current_identity_authenticator_parameters.go +++ b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &DetailCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewDetailCurrentIdentityAuthenticatorParamsWithTimeout creates a new DetailCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *DetailCurrentIdentityAuthenticatorParams { - var () return &DetailCurrentIdentityAuthenticatorParams{ - timeout: timeout, } } // NewDetailCurrentIdentityAuthenticatorParamsWithContext creates a new DetailCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *DetailCurrentIdentityAuthenticatorParams { - var () return &DetailCurrentIdentityAuthenticatorParams{ - Context: ctx, } } // NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new DetailCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *DetailCurrentIdentityAuthenticatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailCurrentIdentityAuthenticatorParams struct { 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) diff --git a/rest_client/current_api_session/detail_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go similarity index 94% rename from rest_client/current_api_session/detail_current_identity_authenticator_responses.go rename to rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go index f8cb5a4ec..8e8aa1649 100644 --- a/rest_client/current_api_session/detail_current_identity_authenticator_responses.go +++ b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go @@ -65,7 +65,6 @@ func (o *DetailCurrentIdentityAuthenticatorReader) ReadResponse(response runtime 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()) } @@ -76,7 +75,7 @@ func NewDetailCurrentIdentityAuthenticatorOK() *DetailCurrentIdentityAuthenticat return &DetailCurrentIdentityAuthenticatorOK{} } -/*DetailCurrentIdentityAuthenticatorOK handles this case with default header values. +/* DetailCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. A singular authenticator resource */ @@ -87,7 +86,6 @@ type DetailCurrentIdentityAuthenticatorOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailCurrentIdentityAuthenticatorUnauthorized() *DetailCurrentIdentityA return &DetailCurrentIdentityAuthenticatorUnauthorized{} } -/*DetailCurrentIdentityAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailCurrentIdentityAuthenticatorUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailCurrentIdentityAuthenticatorNotFound() *DetailCurrentIdentityAuthe return &DetailCurrentIdentityAuthenticatorNotFound{} } -/*DetailCurrentIdentityAuthenticatorNotFound handles this case with default header values. +/* DetailCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailCurrentIdentityAuthenticatorNotFound struct { 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 } diff --git a/rest_client/current_api_session/get_current_api_session_parameters.go b/rest_client_api_client/current_api_session/get_current_api_session_parameters.go similarity index 77% rename from rest_client/current_api_session/get_current_api_session_parameters.go rename to rest_client_api_client/current_api_session/get_current_api_session_parameters.go index d3300d185..8c05178d7 100644 --- a/rest_client/current_api_session/get_current_api_session_parameters.go +++ b/rest_client_api_client/current_api_session/get_current_api_session_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type GetCurrentAPISessionParams struct { 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) diff --git a/rest_client/current_api_session/get_current_api_session_responses.go b/rest_client_api_client/current_api_session/get_current_api_session_responses.go similarity index 95% rename from rest_client/current_api_session/get_current_api_session_responses.go rename to rest_client_api_client/current_api_session/get_current_api_session_responses.go index 57f33f8c9..935fef909 100644 --- a/rest_client/current_api_session/get_current_api_session_responses.go +++ b/rest_client_api_client/current_api_session/get_current_api_session_responses.go @@ -59,7 +59,6 @@ func (o *GetCurrentAPISessionReader) ReadResponse(response runtime.ClientRespons 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()) } @@ -70,7 +69,7 @@ func NewGetCurrentAPISessionOK() *GetCurrentAPISessionOK { return &GetCurrentAPISessionOK{} } -/*GetCurrentAPISessionOK handles this case with default header values. +/* GetCurrentAPISessionOK describes a response with status code 200, with default header values. The API session associated with the session used to issue the request */ @@ -81,7 +80,6 @@ type GetCurrentAPISessionOK struct { 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 } @@ -103,7 +101,7 @@ func NewGetCurrentAPISessionUnauthorized() *GetCurrentAPISessionUnauthorized { return &GetCurrentAPISessionUnauthorized{} } -/*GetCurrentAPISessionUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type GetCurrentAPISessionUnauthorized struct { 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 } diff --git a/rest_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 similarity index 83% rename from rest_client/current_api_session/list_current_api_session_certificates_parameters.go rename to rest_client_api_client/current_api_session/list_current_api_session_certificates_parameters.go index 652df6920..8c926bac0 100644 --- a/rest_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 @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListCurrentAPISessionCertificatesParams creates a new ListCurrentAPISessionCertificatesParams object -// with the default values initialized. +// 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 { - var () return &ListCurrentAPISessionCertificatesParams{ - timeout: cr.DefaultTimeout, } } // NewListCurrentAPISessionCertificatesParamsWithTimeout creates a new ListCurrentAPISessionCertificatesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListCurrentAPISessionCertificatesParamsWithTimeout(timeout time.Duration) *ListCurrentAPISessionCertificatesParams { - var () return &ListCurrentAPISessionCertificatesParams{ - timeout: timeout, } } // NewListCurrentAPISessionCertificatesParamsWithContext creates a new ListCurrentAPISessionCertificatesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListCurrentAPISessionCertificatesParamsWithContext(ctx context.Context) *ListCurrentAPISessionCertificatesParams { - var () return &ListCurrentAPISessionCertificatesParams{ - Context: ctx, } } // NewListCurrentAPISessionCertificatesParamsWithHTTPClient creates a new ListCurrentAPISessionCertificatesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListCurrentAPISessionCertificatesParamsWithHTTPClient(client *http.Client) *ListCurrentAPISessionCertificatesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListCurrentAPISessionCertificatesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListCurrentAPISessionCertificatesParams) WriteToRequest(r runtime.Clien // 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 { diff --git a/rest_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 similarity index 96% rename from rest_client/current_api_session/list_current_api_session_certificates_responses.go rename to rest_client_api_client/current_api_session/list_current_api_session_certificates_responses.go index 755b86124..f74ea800c 100644 --- a/rest_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 @@ -53,7 +53,6 @@ func (o *ListCurrentAPISessionCertificatesReader) ReadResponse(response runtime. 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()) } @@ -64,7 +63,7 @@ func NewListCurrentAPISessionCertificatesOK() *ListCurrentAPISessionCertificates return &ListCurrentAPISessionCertificatesOK{} } -/*ListCurrentAPISessionCertificatesOK handles this case with default header values. +/* ListCurrentAPISessionCertificatesOK describes a response with status code 200, with default header values. A list of the current API Session's certificate */ @@ -75,7 +74,6 @@ type ListCurrentAPISessionCertificatesOK struct { 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 } diff --git a/rest_client/current_api_session/list_current_identity_authenticators_parameters.go b/rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go similarity index 83% rename from rest_client/current_api_session/list_current_identity_authenticators_parameters.go rename to rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go index 1cf70a7cd..2bd843b6d 100644 --- a/rest_client/current_api_session/list_current_identity_authenticators_parameters.go +++ b/rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object -// with the default values initialized. +// 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 { - var () return &ListCurrentIdentityAuthenticatorsParams{ - timeout: cr.DefaultTimeout, } } // NewListCurrentIdentityAuthenticatorsParamsWithTimeout creates a new ListCurrentIdentityAuthenticatorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListCurrentIdentityAuthenticatorsParamsWithTimeout(timeout time.Duration) *ListCurrentIdentityAuthenticatorsParams { - var () return &ListCurrentIdentityAuthenticatorsParams{ - timeout: timeout, } } // NewListCurrentIdentityAuthenticatorsParamsWithContext creates a new ListCurrentIdentityAuthenticatorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListCurrentIdentityAuthenticatorsParamsWithContext(ctx context.Context) *ListCurrentIdentityAuthenticatorsParams { - var () return &ListCurrentIdentityAuthenticatorsParams{ - Context: ctx, } } // NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient creates a new ListCurrentIdentityAuthenticatorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient(client *http.Client) *ListCurrentIdentityAuthenticatorsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListCurrentIdentityAuthenticatorsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListCurrentIdentityAuthenticatorsParams) WriteToRequest(r runtime.Clien // 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 { diff --git a/rest_client/current_api_session/list_current_identity_authenticators_responses.go b/rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go similarity index 95% rename from rest_client/current_api_session/list_current_identity_authenticators_responses.go rename to rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go index 4ed21f1ab..94eb9573a 100644 --- a/rest_client/current_api_session/list_current_identity_authenticators_responses.go +++ b/rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go @@ -59,7 +59,6 @@ func (o *ListCurrentIdentityAuthenticatorsReader) ReadResponse(response runtime. 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()) } @@ -70,7 +69,7 @@ func NewListCurrentIdentityAuthenticatorsOK() *ListCurrentIdentityAuthenticators return &ListCurrentIdentityAuthenticatorsOK{} } -/*ListCurrentIdentityAuthenticatorsOK handles this case with default header values. +/* ListCurrentIdentityAuthenticatorsOK describes a response with status code 200, with default header values. A list of authenticators */ @@ -81,7 +80,6 @@ type ListCurrentIdentityAuthenticatorsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListCurrentIdentityAuthenticatorsUnauthorized() *ListCurrentIdentityAuth return &ListCurrentIdentityAuthenticatorsUnauthorized{} } -/*ListCurrentIdentityAuthenticatorsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListCurrentIdentityAuthenticatorsUnauthorized struct { 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 } diff --git a/rest_client/current_api_session/list_service_updates_parameters.go b/rest_client_api_client/current_api_session/list_service_updates_parameters.go similarity index 77% rename from rest_client/current_api_session/list_service_updates_parameters.go rename to rest_client_api_client/current_api_session/list_service_updates_parameters.go index 7383372a3..95febfaae 100644 --- a/rest_client/current_api_session/list_service_updates_parameters.go +++ b/rest_client_api_client/current_api_session/list_service_updates_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListServiceUpdatesParams creates a new ListServiceUpdatesParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListServiceUpdatesParams struct { 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) diff --git a/rest_client/current_api_session/list_service_updates_responses.go b/rest_client_api_client/current_api_session/list_service_updates_responses.go similarity index 95% rename from rest_client/current_api_session/list_service_updates_responses.go rename to rest_client_api_client/current_api_session/list_service_updates_responses.go index e05c604c2..8c5e8ddd0 100644 --- a/rest_client/current_api_session/list_service_updates_responses.go +++ b/rest_client_api_client/current_api_session/list_service_updates_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceUpdatesReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -70,7 +69,7 @@ func NewListServiceUpdatesOK() *ListServiceUpdatesOK { return &ListServiceUpdatesOK{} } -/*ListServiceUpdatesOK handles this case with default header values. +/* ListServiceUpdatesOK describes a response with status code 200, with default header values. Data indicating necessary service updates */ @@ -81,7 +80,6 @@ type ListServiceUpdatesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceUpdatesUnauthorized() *ListServiceUpdatesUnauthorized { return &ListServiceUpdatesUnauthorized{} } -/*ListServiceUpdatesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceUpdatesUnauthorized struct { 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 } diff --git a/rest_client/current_api_session/patch_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go similarity index 80% rename from rest_client/current_api_session/patch_current_identity_authenticator_parameters.go rename to rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go index 6a750f2c4..debe472c0 100644 --- a/rest_client/current_api_session/patch_current_identity_authenticator_parameters.go +++ b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchCurrentIdentityAuthenticatorParams creates a new PatchCurrentIdentityAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &PatchCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewPatchCurrentIdentityAuthenticatorParamsWithTimeout creates a new PatchCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *PatchCurrentIdentityAuthenticatorParams { - var () return &PatchCurrentIdentityAuthenticatorParams{ - timeout: timeout, } } // NewPatchCurrentIdentityAuthenticatorParamsWithContext creates a new PatchCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *PatchCurrentIdentityAuthenticatorParams { - var () return &PatchCurrentIdentityAuthenticatorParams{ - Context: ctx, } } // NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new PatchCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *PatchCurrentIdentityAuthenticatorParams { - var () 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 +/* 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. + An authenticator patch object */ Authenticator *rest_model.AuthenticatorPatchWithCurrent - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchCurrentIdentityAuthenticatorParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.Clien return err } var res []error - if o.Authenticator != nil { if err := r.SetBodyParam(o.Authenticator); err != nil { return err diff --git a/rest_client/current_api_session/patch_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go similarity index 93% rename from rest_client/current_api_session/patch_current_identity_authenticator_responses.go rename to rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go index 7d9873236..6aff8c0bd 100644 --- a/rest_client/current_api_session/patch_current_identity_authenticator_responses.go +++ b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go @@ -71,7 +71,6 @@ func (o *PatchCurrentIdentityAuthenticatorReader) ReadResponse(response runtime. 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()) } @@ -82,7 +81,7 @@ func NewPatchCurrentIdentityAuthenticatorOK() *PatchCurrentIdentityAuthenticator return &PatchCurrentIdentityAuthenticatorOK{} } -/*PatchCurrentIdentityAuthenticatorOK handles this case with default header values. +/* PatchCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchCurrentIdentityAuthenticatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchCurrentIdentityAuthenticatorBadRequest() *PatchCurrentIdentityAuthe return &PatchCurrentIdentityAuthenticatorBadRequest{} } -/*PatchCurrentIdentityAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchCurrentIdentityAuthenticatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchCurrentIdentityAuthenticatorUnauthorized() *PatchCurrentIdentityAut return &PatchCurrentIdentityAuthenticatorUnauthorized{} } -/*PatchCurrentIdentityAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchCurrentIdentityAuthenticatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchCurrentIdentityAuthenticatorNotFound() *PatchCurrentIdentityAuthent return &PatchCurrentIdentityAuthenticatorNotFound{} } -/*PatchCurrentIdentityAuthenticatorNotFound handles this case with default header values. +/* PatchCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchCurrentIdentityAuthenticatorNotFound struct { 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 } diff --git a/rest_client/current_api_session/update_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go similarity index 80% rename from rest_client/current_api_session/update_current_identity_authenticator_parameters.go rename to rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go index a6f02ac86..7cd4d10ea 100644 --- a/rest_client/current_api_session/update_current_identity_authenticator_parameters.go +++ b/rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateCurrentIdentityAuthenticatorParams creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *UpdateCurrentIdentityAuthenticatorParams { - var () return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: timeout, } } // NewUpdateCurrentIdentityAuthenticatorParamsWithContext creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *UpdateCurrentIdentityAuthenticatorParams { - var () return &UpdateCurrentIdentityAuthenticatorParams{ - Context: ctx, } } // NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *UpdateCurrentIdentityAuthenticatorParams { - var () 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 +/* 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. + An authenticator put object */ Authenticator *rest_model.AuthenticatorUpdateWithCurrent - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateCurrentIdentityAuthenticatorParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.Clie return err } var res []error - if o.Authenticator != nil { if err := r.SetBodyParam(o.Authenticator); err != nil { return err diff --git a/rest_client/current_api_session/update_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go similarity index 93% rename from rest_client/current_api_session/update_current_identity_authenticator_responses.go rename to rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go index 139e6e53b..ec70db64d 100644 --- a/rest_client/current_api_session/update_current_identity_authenticator_responses.go +++ b/rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go @@ -71,7 +71,6 @@ func (o *UpdateCurrentIdentityAuthenticatorReader) ReadResponse(response runtime 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()) } @@ -82,7 +81,7 @@ func NewUpdateCurrentIdentityAuthenticatorOK() *UpdateCurrentIdentityAuthenticat return &UpdateCurrentIdentityAuthenticatorOK{} } -/*UpdateCurrentIdentityAuthenticatorOK handles this case with default header values. +/* UpdateCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateCurrentIdentityAuthenticatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateCurrentIdentityAuthenticatorBadRequest() *UpdateCurrentIdentityAut return &UpdateCurrentIdentityAuthenticatorBadRequest{} } -/*UpdateCurrentIdentityAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateCurrentIdentityAuthenticatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateCurrentIdentityAuthenticatorUnauthorized() *UpdateCurrentIdentityA return &UpdateCurrentIdentityAuthenticatorUnauthorized{} } -/*UpdateCurrentIdentityAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateCurrentIdentityAuthenticatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateCurrentIdentityAuthenticatorNotFound() *UpdateCurrentIdentityAuthe return &UpdateCurrentIdentityAuthenticatorNotFound{} } -/*UpdateCurrentIdentityAuthenticatorNotFound handles this case with default header values. +/* UpdateCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateCurrentIdentityAuthenticatorNotFound struct { 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 } diff --git a/rest_client/current_identity/create_mfa_recovery_codes_parameters.go b/rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go similarity index 79% rename from rest_client/current_identity/create_mfa_recovery_codes_parameters.go rename to rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go index 710c518f4..873b02559 100644 --- a/rest_client/current_identity/create_mfa_recovery_codes_parameters.go +++ b/rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateMfaRecoveryCodesParams creates a new CreateMfaRecoveryCodesParams object -// with the default values initialized. +// 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 { - var () return &CreateMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, } } // NewCreateMfaRecoveryCodesParamsWithTimeout creates a new CreateMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *CreateMfaRecoveryCodesParams { - var () return &CreateMfaRecoveryCodesParams{ - timeout: timeout, } } // NewCreateMfaRecoveryCodesParamsWithContext creates a new CreateMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateMfaRecoveryCodesParamsWithContext(ctx context.Context) *CreateMfaRecoveryCodesParams { - var () return &CreateMfaRecoveryCodesParams{ - Context: ctx, } } // NewCreateMfaRecoveryCodesParamsWithHTTPClient creates a new CreateMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *CreateMfaRecoveryCodesParams { - var () 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 +/* 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. + An MFA validation request */ MfaValidation *rest_model.MfaCode @@ -97,6 +96,21 @@ type CreateMfaRecoveryCodesParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.MfaValidation != nil { if err := r.SetBodyParam(o.MfaValidation); err != nil { return err diff --git a/rest_client/current_identity/create_mfa_recovery_codes_responses.go b/rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go similarity index 94% rename from rest_client/current_identity/create_mfa_recovery_codes_responses.go rename to rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go index 2e9a863df..9479e708f 100644 --- a/rest_client/current_identity/create_mfa_recovery_codes_responses.go +++ b/rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go @@ -65,7 +65,6 @@ func (o *CreateMfaRecoveryCodesReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewCreateMfaRecoveryCodesOK() *CreateMfaRecoveryCodesOK { return &CreateMfaRecoveryCodesOK{} } -/*CreateMfaRecoveryCodesOK handles this case with default header values. +/* CreateMfaRecoveryCodesOK describes a response with status code 200, with default header values. The recovery codes of an MFA enrollment */ @@ -87,7 +86,6 @@ type CreateMfaRecoveryCodesOK struct { 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 } @@ -109,7 +107,7 @@ func NewCreateMfaRecoveryCodesUnauthorized() *CreateMfaRecoveryCodesUnauthorized return &CreateMfaRecoveryCodesUnauthorized{} } -/*CreateMfaRecoveryCodesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateMfaRecoveryCodesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewCreateMfaRecoveryCodesNotFound() *CreateMfaRecoveryCodesNotFound { return &CreateMfaRecoveryCodesNotFound{} } -/*CreateMfaRecoveryCodesNotFound handles this case with default header values. +/* CreateMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type CreateMfaRecoveryCodesNotFound struct { 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 } diff --git a/rest_client/current_identity/current_identity_client.go b/rest_client_api_client/current_identity/current_identity_client.go similarity index 85% rename from rest_client/current_identity/current_identity_client.go rename to rest_client_api_client/current_identity/current_identity_client.go index 11e4f15e5..4e2e8eade 100644 --- a/rest_client/current_identity/current_identity_client.go +++ b/rest_client_api_client/current_identity/current_identity_client.go @@ -49,25 +49,28 @@ type Client struct { 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) (*CreateMfaRecoveryCodesOK, error) + CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) - DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteMfaOK, error) + DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) - DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter) (*DetailMfaOK, error) + DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) - DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailMfaQrCodeOK, error) + DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) - DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter) (*DetailMfaRecoveryCodesOK, error) + DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) - EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter) (*EnrollMfaCreated, error) + EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) - GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentIdentityOK, error) + GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) - GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentIdentityEdgeRoutersOK, error) + GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityEdgeRoutersOK, error) - VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter) (*VerifyMfaOK, error) + VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) SetTransport(transport runtime.ClientTransport) } @@ -78,13 +81,12 @@ type ClientService interface { 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) (*CreateMfaRecoveryCodesOK, error) { +func (a *Client) CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateMfaRecoveryCodesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createMfaRecoveryCodes", Method: "POST", PathPattern: "/current-identity/mfa/recovery-codes", @@ -96,7 +98,12 @@ func (a *Client) CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, au 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 } @@ -116,13 +123,12 @@ func (a *Client) CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, au 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) (*DeleteMfaOK, error) { +func (a *Client) DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteMfa", Method: "DELETE", PathPattern: "/current-identity/mfa", @@ -134,7 +140,12 @@ func (a *Client) DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthI 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 } @@ -154,13 +165,12 @@ func (a *Client) DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthI 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) (*DetailMfaOK, error) { +func (a *Client) DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailMfa", Method: "GET", PathPattern: "/current-identity/mfa", @@ -172,7 +182,12 @@ func (a *Client) DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthI 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 } @@ -192,13 +207,12 @@ func (a *Client) DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthI 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) (*DetailMfaQrCodeOK, error) { +func (a *Client) DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailMfaQrCodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailMfaQrCode", Method: "GET", PathPattern: "/current-identity/mfa/qr-code", @@ -210,7 +224,12 @@ func (a *Client) DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime 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 } @@ -230,13 +249,12 @@ func (a *Client) DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime 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) (*DetailMfaRecoveryCodesOK, error) { +func (a *Client) DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailMfaRecoveryCodesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailMfaRecoveryCodes", Method: "GET", PathPattern: "/current-identity/mfa/recovery-codes", @@ -248,7 +266,12 @@ func (a *Client) DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, au 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 } @@ -268,13 +291,12 @@ func (a *Client) DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, au 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) (*EnrollMfaCreated, error) { +func (a *Client) EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enrollMfa", Method: "POST", PathPattern: "/current-identity/mfa", @@ -286,7 +308,12 @@ func (a *Client) EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthI 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 } @@ -305,13 +332,12 @@ func (a *Client) EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthI Returns the identity associated with the API sessions used to issue the current request */ -func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentIdentityOK, error) { +func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCurrentIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCurrentIdentity", Method: "GET", PathPattern: "/current-identity", @@ -323,7 +349,12 @@ func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo r 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 } @@ -344,13 +375,12 @@ func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo r includes their address and online status */ -func (a *Client) GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentIdentityEdgeRoutersOK, error) { +func (a *Client) GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCurrentIdentityEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCurrentIdentityEdgeRouters", Method: "GET", PathPattern: "/current-identity/edge-routers", @@ -362,7 +392,12 @@ func (a *Client) GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRou 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 } @@ -382,13 +417,12 @@ func (a *Client) GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRou 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) (*VerifyMfaOK, error) { +func (a *Client) VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVerifyMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "verifyMfa", Method: "POST", PathPattern: "/current-identity/mfa/verify", @@ -400,7 +434,12 @@ func (a *Client) VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthI 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 } diff --git a/rest_client/current_identity/delete_mfa_parameters.go b/rest_client_api_client/current_identity/delete_mfa_parameters.go similarity index 80% rename from rest_client/current_identity/delete_mfa_parameters.go rename to rest_client_api_client/current_identity/delete_mfa_parameters.go index 319fd103d..61d6c3dce 100644 --- a/rest_client/current_identity/delete_mfa_parameters.go +++ b/rest_client_api_client/current_identity/delete_mfa_parameters.go @@ -42,55 +42,55 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewDeleteMfaParams creates a new DeleteMfaParams object -// with the default values initialized. +// 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 { - var () return &DeleteMfaParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteMfaParamsWithTimeout creates a new DeleteMfaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteMfaParamsWithTimeout(timeout time.Duration) *DeleteMfaParams { - var () return &DeleteMfaParams{ - timeout: timeout, } } // NewDeleteMfaParamsWithContext creates a new DeleteMfaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteMfaParamsWithContext(ctx context.Context) *DeleteMfaParams { - var () return &DeleteMfaParams{ - Context: ctx, } } // NewDeleteMfaParamsWithHTTPClient creates a new DeleteMfaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteMfaParamsWithHTTPClient(client *http.Client) *DeleteMfaParams { - var () 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 +/* 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. MfaValidationCode *string - /*MfaValidation - An MFA validation request + /* MfaValidation. + + An MFA validation request */ MfaValidation *rest_model.MfaCode @@ -99,6 +99,21 @@ type DeleteMfaParams struct { 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) @@ -168,9 +183,7 @@ func (o *DeleteMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg 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 diff --git a/rest_client/current_identity/delete_mfa_responses.go b/rest_client_api_client/current_identity/delete_mfa_responses.go similarity index 94% rename from rest_client/current_identity/delete_mfa_responses.go rename to rest_client_api_client/current_identity/delete_mfa_responses.go index 73e9b5463..4b819f28f 100644 --- a/rest_client/current_identity/delete_mfa_responses.go +++ b/rest_client_api_client/current_identity/delete_mfa_responses.go @@ -65,7 +65,6 @@ func (o *DeleteMfaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewDeleteMfaOK() *DeleteMfaOK { return &DeleteMfaOK{} } -/*DeleteMfaOK handles this case with default header values. +/* DeleteMfaOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type DeleteMfaOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteMfaUnauthorized() *DeleteMfaUnauthorized { return &DeleteMfaUnauthorized{} } -/*DeleteMfaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteMfaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteMfaNotFound() *DeleteMfaNotFound { return &DeleteMfaNotFound{} } -/*DeleteMfaNotFound handles this case with default header values. +/* DeleteMfaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DeleteMfaNotFound struct { 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 } diff --git a/rest_client/current_identity/detail_mfa_parameters.go b/rest_client_api_client/current_identity/detail_mfa_parameters.go similarity index 76% rename from rest_client/current_identity/detail_mfa_parameters.go rename to rest_client_api_client/current_identity/detail_mfa_parameters.go index 606077ddf..1129729c8 100644 --- a/rest_client/current_identity/detail_mfa_parameters.go +++ b/rest_client_api_client/current_identity/detail_mfa_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailMfaParams creates a new DetailMfaParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type DetailMfaParams struct { 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) diff --git a/rest_client/current_identity/detail_mfa_qr_code_parameters.go b/rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go similarity index 77% rename from rest_client/current_identity/detail_mfa_qr_code_parameters.go rename to rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go index e861d1e34..f6a932d9c 100644 --- a/rest_client/current_identity/detail_mfa_qr_code_parameters.go +++ b/rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type DetailMfaQrCodeParams struct { 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) diff --git a/rest_client/current_identity/detail_mfa_qr_code_responses.go b/rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go similarity index 94% rename from rest_client/current_identity/detail_mfa_qr_code_responses.go rename to rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go index 59f22bdd7..3c643d6fe 100644 --- a/rest_client/current_identity/detail_mfa_qr_code_responses.go +++ b/rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go @@ -56,7 +56,6 @@ func (o *DetailMfaQrCodeReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -67,7 +66,7 @@ func NewDetailMfaQrCodeOK() *DetailMfaQrCodeOK { return &DetailMfaQrCodeOK{} } -/*DetailMfaQrCodeOK handles this case with default header values. +/* DetailMfaQrCodeOK describes a response with status code 200, with default header values. OK */ @@ -88,7 +87,7 @@ func NewDetailMfaQrCodeNotFound() *DetailMfaQrCodeNotFound { return &DetailMfaQrCodeNotFound{} } -/*DetailMfaQrCodeNotFound handles this case with default header values. +/* DetailMfaQrCodeNotFound describes a response with status code 404, with default header values. No MFA enrollment or MFA enrollment is completed */ diff --git a/rest_client/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go similarity index 81% rename from rest_client/current_identity/detail_mfa_recovery_codes_parameters.go rename to rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go index d69f2e65b..3775fbf49 100644 --- a/rest_client/current_identity/detail_mfa_recovery_codes_parameters.go +++ b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go @@ -42,55 +42,55 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewDetailMfaRecoveryCodesParams creates a new DetailMfaRecoveryCodesParams object -// with the default values initialized. +// 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 { - var () return &DetailMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, } } // NewDetailMfaRecoveryCodesParamsWithTimeout creates a new DetailMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *DetailMfaRecoveryCodesParams { - var () return &DetailMfaRecoveryCodesParams{ - timeout: timeout, } } // NewDetailMfaRecoveryCodesParamsWithContext creates a new DetailMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailMfaRecoveryCodesParamsWithContext(ctx context.Context) *DetailMfaRecoveryCodesParams { - var () return &DetailMfaRecoveryCodesParams{ - Context: ctx, } } // NewDetailMfaRecoveryCodesParamsWithHTTPClient creates a new DetailMfaRecoveryCodesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *DetailMfaRecoveryCodesParams { - var () 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 +/* 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. MfaValidationCode *string - /*MfaValidation - An MFA validation request + /* MfaValidation. + + An MFA validation request */ MfaValidation *rest_model.MfaCode @@ -99,6 +99,21 @@ type DetailMfaRecoveryCodesParams struct { 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) @@ -168,9 +183,7 @@ func (o *DetailMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, r 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 diff --git a/rest_client/current_identity/detail_mfa_recovery_codes_responses.go b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go similarity index 94% rename from rest_client/current_identity/detail_mfa_recovery_codes_responses.go rename to rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go index 932312de3..5cb19835f 100644 --- a/rest_client/current_identity/detail_mfa_recovery_codes_responses.go +++ b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go @@ -65,7 +65,6 @@ func (o *DetailMfaRecoveryCodesReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewDetailMfaRecoveryCodesOK() *DetailMfaRecoveryCodesOK { return &DetailMfaRecoveryCodesOK{} } -/*DetailMfaRecoveryCodesOK handles this case with default header values. +/* DetailMfaRecoveryCodesOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type DetailMfaRecoveryCodesOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailMfaRecoveryCodesUnauthorized() *DetailMfaRecoveryCodesUnauthorized return &DetailMfaRecoveryCodesUnauthorized{} } -/*DetailMfaRecoveryCodesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailMfaRecoveryCodesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailMfaRecoveryCodesNotFound() *DetailMfaRecoveryCodesNotFound { return &DetailMfaRecoveryCodesNotFound{} } -/*DetailMfaRecoveryCodesNotFound handles this case with default header values. +/* DetailMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailMfaRecoveryCodesNotFound struct { 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 } diff --git a/rest_client/current_identity/detail_mfa_responses.go b/rest_client_api_client/current_identity/detail_mfa_responses.go similarity index 94% rename from rest_client/current_identity/detail_mfa_responses.go rename to rest_client_api_client/current_identity/detail_mfa_responses.go index 0be9f472e..e72d18ce1 100644 --- a/rest_client/current_identity/detail_mfa_responses.go +++ b/rest_client_api_client/current_identity/detail_mfa_responses.go @@ -65,7 +65,6 @@ func (o *DetailMfaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewDetailMfaOK() *DetailMfaOK { return &DetailMfaOK{} } -/*DetailMfaOK handles this case with default header values. +/* DetailMfaOK describes a response with status code 200, with default header values. The details of an MFA enrollment */ @@ -87,7 +86,6 @@ type DetailMfaOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailMfaUnauthorized() *DetailMfaUnauthorized { return &DetailMfaUnauthorized{} } -/*DetailMfaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailMfaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailMfaNotFound() *DetailMfaNotFound { return &DetailMfaNotFound{} } -/*DetailMfaNotFound handles this case with default header values. +/* DetailMfaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailMfaNotFound struct { 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 } diff --git a/rest_client/current_identity/enroll_mfa_parameters.go b/rest_client_api_client/current_identity/enroll_mfa_parameters.go similarity index 76% rename from rest_client/current_identity/enroll_mfa_parameters.go rename to rest_client_api_client/current_identity/enroll_mfa_parameters.go index eb5e46433..45bdeb753 100644 --- a/rest_client/current_identity/enroll_mfa_parameters.go +++ b/rest_client_api_client/current_identity/enroll_mfa_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollMfaParams creates a new EnrollMfaParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type EnrollMfaParams struct { 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) diff --git a/rest_client/current_identity/enroll_mfa_responses.go b/rest_client_api_client/current_identity/enroll_mfa_responses.go similarity index 94% rename from rest_client/current_identity/enroll_mfa_responses.go rename to rest_client_api_client/current_identity/enroll_mfa_responses.go index 5f00aeb4f..d97c57c69 100644 --- a/rest_client/current_identity/enroll_mfa_responses.go +++ b/rest_client_api_client/current_identity/enroll_mfa_responses.go @@ -65,7 +65,6 @@ func (o *EnrollMfaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewEnrollMfaCreated() *EnrollMfaCreated { return &EnrollMfaCreated{} } -/*EnrollMfaCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type EnrollMfaCreated struct { 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 } @@ -109,7 +107,7 @@ func NewEnrollMfaUnauthorized() *EnrollMfaUnauthorized { return &EnrollMfaUnauthorized{} } -/*EnrollMfaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type EnrollMfaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewEnrollMfaConflict() *EnrollMfaConflict { return &EnrollMfaConflict{} } -/*EnrollMfaConflict handles this case with default header values. +/* EnrollMfaConflict describes a response with status code 409, with default header values. The identity is already enrolled in MFA */ @@ -153,7 +150,6 @@ type EnrollMfaConflict struct { 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 } diff --git a/rest_client/current_identity/get_current_identity_edge_routers_parameters.go b/rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go similarity index 77% rename from rest_client/current_identity/get_current_identity_edge_routers_parameters.go rename to rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go index ca76cc21f..f07fda8c9 100644 --- a/rest_client/current_identity/get_current_identity_edge_routers_parameters.go +++ b/rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCurrentIdentityEdgeRoutersParams creates a new GetCurrentIdentityEdgeRoutersParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type GetCurrentIdentityEdgeRoutersParams struct { 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) diff --git a/rest_client/current_identity/get_current_identity_edge_routers_responses.go b/rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go similarity index 95% rename from rest_client/current_identity/get_current_identity_edge_routers_responses.go rename to rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go index 871cd66a2..1b4d81157 100644 --- a/rest_client/current_identity/get_current_identity_edge_routers_responses.go +++ b/rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go @@ -59,7 +59,6 @@ func (o *GetCurrentIdentityEdgeRoutersReader) ReadResponse(response runtime.Clie 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()) } @@ -70,7 +69,7 @@ func NewGetCurrentIdentityEdgeRoutersOK() *GetCurrentIdentityEdgeRoutersOK { return &GetCurrentIdentityEdgeRoutersOK{} } -/*GetCurrentIdentityEdgeRoutersOK handles this case with default header values. +/* GetCurrentIdentityEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -81,7 +80,6 @@ type GetCurrentIdentityEdgeRoutersOK struct { 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 } @@ -103,7 +101,7 @@ func NewGetCurrentIdentityEdgeRoutersUnauthorized() *GetCurrentIdentityEdgeRoute return &GetCurrentIdentityEdgeRoutersUnauthorized{} } -/*GetCurrentIdentityEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type GetCurrentIdentityEdgeRoutersUnauthorized struct { 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 } diff --git a/rest_client/current_identity/get_current_identity_parameters.go b/rest_client_api_client/current_identity/get_current_identity_parameters.go similarity index 77% rename from rest_client/current_identity/get_current_identity_parameters.go rename to rest_client_api_client/current_identity/get_current_identity_parameters.go index f3f3883eb..73149df3e 100644 --- a/rest_client/current_identity/get_current_identity_parameters.go +++ b/rest_client_api_client/current_identity/get_current_identity_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type GetCurrentIdentityParams struct { 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) diff --git a/rest_client/current_identity/get_current_identity_responses.go b/rest_client_api_client/current_identity/get_current_identity_responses.go similarity index 95% rename from rest_client/current_identity/get_current_identity_responses.go rename to rest_client_api_client/current_identity/get_current_identity_responses.go index 53360ead7..367b324c9 100644 --- a/rest_client/current_identity/get_current_identity_responses.go +++ b/rest_client_api_client/current_identity/get_current_identity_responses.go @@ -59,7 +59,6 @@ func (o *GetCurrentIdentityReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -70,7 +69,7 @@ func NewGetCurrentIdentityOK() *GetCurrentIdentityOK { return &GetCurrentIdentityOK{} } -/*GetCurrentIdentityOK handles this case with default header values. +/* GetCurrentIdentityOK describes a response with status code 200, with default header values. The identity associated with the API Session used to issue the request */ @@ -81,7 +80,6 @@ type GetCurrentIdentityOK struct { 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 } @@ -103,7 +101,7 @@ func NewGetCurrentIdentityUnauthorized() *GetCurrentIdentityUnauthorized { return &GetCurrentIdentityUnauthorized{} } -/*GetCurrentIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type GetCurrentIdentityUnauthorized struct { 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 } diff --git a/rest_client/current_identity/verify_mfa_parameters.go b/rest_client_api_client/current_identity/verify_mfa_parameters.go similarity index 78% rename from rest_client/current_identity/verify_mfa_parameters.go rename to rest_client_api_client/current_identity/verify_mfa_parameters.go index 3e82f8c0b..dcc00d18e 100644 --- a/rest_client/current_identity/verify_mfa_parameters.go +++ b/rest_client_api_client/current_identity/verify_mfa_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewVerifyMfaParams creates a new VerifyMfaParams object -// with the default values initialized. +// 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 { - var () return &VerifyMfaParams{ - timeout: cr.DefaultTimeout, } } // NewVerifyMfaParamsWithTimeout creates a new VerifyMfaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewVerifyMfaParamsWithTimeout(timeout time.Duration) *VerifyMfaParams { - var () return &VerifyMfaParams{ - timeout: timeout, } } // NewVerifyMfaParamsWithContext creates a new VerifyMfaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewVerifyMfaParamsWithContext(ctx context.Context) *VerifyMfaParams { - var () return &VerifyMfaParams{ - Context: ctx, } } // NewVerifyMfaParamsWithHTTPClient creates a new VerifyMfaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewVerifyMfaParamsWithHTTPClient(client *http.Client) *VerifyMfaParams { - var () 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 +/* 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. + An MFA validation request */ MfaValidation *rest_model.MfaCode @@ -97,6 +96,21 @@ type VerifyMfaParams struct { 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) @@ -148,7 +162,6 @@ func (o *VerifyMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg return err } var res []error - if o.MfaValidation != nil { if err := r.SetBodyParam(o.MfaValidation); err != nil { return err diff --git a/rest_client/current_identity/verify_mfa_responses.go b/rest_client_api_client/current_identity/verify_mfa_responses.go similarity index 94% rename from rest_client/current_identity/verify_mfa_responses.go rename to rest_client_api_client/current_identity/verify_mfa_responses.go index 07f728c27..e812bd325 100644 --- a/rest_client/current_identity/verify_mfa_responses.go +++ b/rest_client_api_client/current_identity/verify_mfa_responses.go @@ -65,7 +65,6 @@ func (o *VerifyMfaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewVerifyMfaOK() *VerifyMfaOK { return &VerifyMfaOK{} } -/*VerifyMfaOK handles this case with default header values. +/* VerifyMfaOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type VerifyMfaOK struct { 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 } @@ -109,7 +107,7 @@ func NewVerifyMfaUnauthorized() *VerifyMfaUnauthorized { return &VerifyMfaUnauthorized{} } -/*VerifyMfaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type VerifyMfaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewVerifyMfaNotFound() *VerifyMfaNotFound { return &VerifyMfaNotFound{} } -/*VerifyMfaNotFound handles this case with default header values. +/* VerifyMfaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type VerifyMfaNotFound struct { 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 } diff --git a/rest_client/enroll/enroll_ca_parameters.go b/rest_client_api_client/enroll/enroll_ca_parameters.go similarity index 75% rename from rest_client/enroll/enroll_ca_parameters.go rename to rest_client_api_client/enroll/enroll_ca_parameters.go index 2ddbdeb78..cb18b6976 100644 --- a/rest_client/enroll/enroll_ca_parameters.go +++ b/rest_client_api_client/enroll/enroll_ca_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollCaParams creates a new EnrollCaParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type EnrollCaParams struct { 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) diff --git a/rest_client/enroll/enroll_ca_responses.go b/rest_client_api_client/enroll/enroll_ca_responses.go similarity index 95% rename from rest_client/enroll/enroll_ca_responses.go rename to rest_client_api_client/enroll/enroll_ca_responses.go index 1c8389de0..044596c14 100644 --- a/rest_client/enroll/enroll_ca_responses.go +++ b/rest_client_api_client/enroll/enroll_ca_responses.go @@ -59,7 +59,6 @@ func (o *EnrollCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -70,7 +69,7 @@ func NewEnrollCaOK() *EnrollCaOK { return &EnrollCaOK{} } -/*EnrollCaOK handles this case with default header values. +/* EnrollCaOK describes a response with status code 200, with default header values. Base empty response */ @@ -81,7 +80,6 @@ type EnrollCaOK struct { 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 } @@ -103,7 +101,7 @@ func NewEnrollCaNotFound() *EnrollCaNotFound { return &EnrollCaNotFound{} } -/*EnrollCaNotFound handles this case with default header values. +/* EnrollCaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -114,7 +112,6 @@ type EnrollCaNotFound struct { 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 } diff --git a/rest_client/enroll/enroll_client.go b/rest_client_api_client/enroll/enroll_client.go similarity index 83% rename from rest_client/enroll/enroll_client.go rename to rest_client_api_client/enroll/enroll_client.go index c42dde64c..0265805f9 100644 --- a/rest_client/enroll/enroll_client.go +++ b/rest_client_api_client/enroll/enroll_client.go @@ -49,21 +49,24 @@ type Client struct { 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) (*EnrollOK, error) + Enroll(params *EnrollParams, opts ...ClientOption) (*EnrollOK, error) - EnrollCa(params *EnrollCaParams) (*EnrollCaOK, error) + EnrollCa(params *EnrollCaParams, opts ...ClientOption) (*EnrollCaOK, error) - EnrollErOtt(params *EnrollErOttParams) (*EnrollErOttOK, error) + EnrollErOtt(params *EnrollErOttParams, opts ...ClientOption) (*EnrollErOttOK, error) - EnrollOtt(params *EnrollOttParams) (*EnrollOttOK, error) + EnrollOtt(params *EnrollOttParams, opts ...ClientOption) (*EnrollOttOK, error) - EnrollOttCa(params *EnrollOttCaParams) (*EnrollOttCaOK, error) + EnrollOttCa(params *EnrollOttCaParams, opts ...ClientOption) (*EnrollOttCaOK, error) - ErnollUpdb(params *ErnollUpdbParams) (*ErnollUpdbOK, error) + ErnollUpdb(params *ErnollUpdbParams, opts ...ClientOption) (*ErnollUpdbOK, error) - ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams) (*ExtendRouterEnrollmentOK, error) + ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams, opts ...ClientOption) (*ExtendRouterEnrollmentOK, error) SetTransport(transport runtime.ClientTransport) } @@ -73,13 +76,12 @@ type ClientService interface { endpoint defers to the logic in the more specific `enroll/*` endpoints */ -func (a *Client) Enroll(params *EnrollParams) (*EnrollOK, error) { +func (a *Client) Enroll(params *EnrollParams, opts ...ClientOption) (*EnrollOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enroll", Method: "POST", PathPattern: "/enroll", @@ -90,7 +92,12 @@ func (a *Client) Enroll(params *EnrollParams) (*EnrollOK, error) { 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 } @@ -114,13 +121,12 @@ Certificate Authority that has been added and verified (See POST /cas and POST / 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) (*EnrollCaOK, error) { +func (a *Client) EnrollCa(params *EnrollCaParams, opts ...ClientOption) (*EnrollCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enrollCa", Method: "POST", PathPattern: "/enroll/ca", @@ -131,7 +137,12 @@ func (a *Client) EnrollCa(params *EnrollCaParams) (*EnrollCaOK, error) { 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 } @@ -151,13 +162,12 @@ func (a *Client) EnrollCa(params *EnrollCaParams) (*EnrollCaOK, error) { Enrolls an edge-router via a one-time-token to establish a certificate based identity. */ -func (a *Client) EnrollErOtt(params *EnrollErOttParams) (*EnrollErOttOK, error) { +func (a *Client) EnrollErOtt(params *EnrollErOttParams, opts ...ClientOption) (*EnrollErOttOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollErOttParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enrollErOtt", Method: "POST", PathPattern: "/enroll/erott", @@ -168,7 +178,12 @@ func (a *Client) EnrollErOtt(params *EnrollErOttParams) (*EnrollErOttOK, error) 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 } @@ -190,13 +205,12 @@ expects a PEM encoded CSRs to be provided for fulfillment. It is up to the enrol private key backing the CSR request. */ -func (a *Client) EnrollOtt(params *EnrollOttParams) (*EnrollOttOK, error) { +func (a *Client) EnrollOtt(params *EnrollOttParams, opts ...ClientOption) (*EnrollOttOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollOttParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enrollOtt", Method: "POST", PathPattern: "/enroll/ott", @@ -207,7 +221,12 @@ func (a *Client) EnrollOtt(params *EnrollOttParams) (*EnrollOttOK, error) { 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 } @@ -232,13 +251,12 @@ 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) (*EnrollOttCaOK, error) { +func (a *Client) EnrollOttCa(params *EnrollOttCaParams, opts ...ClientOption) (*EnrollOttCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewEnrollOttCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "enrollOttCa", Method: "POST", PathPattern: "/enroll/ottca", @@ -249,7 +267,12 @@ func (a *Client) EnrollOttCa(params *EnrollOttCaParams) (*EnrollOttCaOK, error) 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 } @@ -269,13 +292,12 @@ func (a *Client) EnrollOttCa(params *EnrollOttCaParams) (*EnrollOttCaOK, error) Enrolls an identity via a one-time-token to establish an initial username and password combination */ -func (a *Client) ErnollUpdb(params *ErnollUpdbParams) (*ErnollUpdbOK, error) { +func (a *Client) ErnollUpdb(params *ErnollUpdbParams, opts ...ClientOption) (*ErnollUpdbOK, error) { // TODO: Validate the params before sending if params == nil { params = NewErnollUpdbParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ernollUpdb", Method: "POST", PathPattern: "/enroll/updb", @@ -286,7 +308,12 @@ func (a *Client) ErnollUpdb(params *ErnollUpdbParams) (*ErnollUpdbOK, error) { 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 } @@ -314,13 +341,12 @@ has not expired. This request must be made using the existing, valid, client certificate. */ -func (a *Client) ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams) (*ExtendRouterEnrollmentOK, error) { +func (a *Client) ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams, opts ...ClientOption) (*ExtendRouterEnrollmentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewExtendRouterEnrollmentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "extendRouterEnrollment", Method: "POST", PathPattern: "/enroll/extend/router", @@ -331,7 +357,12 @@ func (a *Client) ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams) (* 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 } diff --git a/rest_client/enroll/enroll_er_ott_parameters.go b/rest_client_api_client/enroll/enroll_er_ott_parameters.go similarity index 77% rename from rest_client/enroll/enroll_er_ott_parameters.go rename to rest_client_api_client/enroll/enroll_er_ott_parameters.go index 812407d97..92a411a50 100644 --- a/rest_client/enroll/enroll_er_ott_parameters.go +++ b/rest_client_api_client/enroll/enroll_er_ott_parameters.go @@ -40,51 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollErOttParams creates a new EnrollErOttParams object -// with the default values initialized. +// 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 { - var () return &EnrollErOttParams{ - timeout: cr.DefaultTimeout, } } // NewEnrollErOttParamsWithTimeout creates a new EnrollErOttParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnrollErOttParamsWithTimeout(timeout time.Duration) *EnrollErOttParams { - var () return &EnrollErOttParams{ - timeout: timeout, } } // NewEnrollErOttParamsWithContext creates a new EnrollErOttParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnrollErOttParamsWithContext(ctx context.Context) *EnrollErOttParams { - var () return &EnrollErOttParams{ - Context: ctx, } } // NewEnrollErOttParamsWithHTTPClient creates a new EnrollErOttParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnrollErOttParamsWithHTTPClient(client *http.Client) *EnrollErOttParams { - var () 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 +/* 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*/ + // Token. + // + // Format: uuid Token strfmt.UUID timeout time.Duration @@ -92,6 +93,21 @@ type EnrollErOttParams struct { 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) @@ -148,6 +164,7 @@ func (o *EnrollErOttParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R qrToken := o.Token qToken := qrToken.String() if qToken != "" { + if err := r.SetQueryParam("token", qToken); err != nil { return err } diff --git a/rest_client/enroll/enroll_er_ott_responses.go b/rest_client_api_client/enroll/enroll_er_ott_responses.go similarity index 96% rename from rest_client/enroll/enroll_er_ott_responses.go rename to rest_client_api_client/enroll/enroll_er_ott_responses.go index 0da6dade5..47da0c707 100644 --- a/rest_client/enroll/enroll_er_ott_responses.go +++ b/rest_client_api_client/enroll/enroll_er_ott_responses.go @@ -53,7 +53,6 @@ func (o *EnrollErOttReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -64,7 +63,7 @@ func NewEnrollErOttOK() *EnrollErOttOK { return &EnrollErOttOK{} } -/*EnrollErOttOK handles this case with default header values. +/* 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). */ @@ -75,7 +74,6 @@ type EnrollErOttOK struct { 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 } diff --git a/rest_client/enroll/enroll_ott_ca_parameters.go b/rest_client_api_client/enroll/enroll_ott_ca_parameters.go similarity index 77% rename from rest_client/enroll/enroll_ott_ca_parameters.go rename to rest_client_api_client/enroll/enroll_ott_ca_parameters.go index 633130ce2..74596162e 100644 --- a/rest_client/enroll/enroll_ott_ca_parameters.go +++ b/rest_client_api_client/enroll/enroll_ott_ca_parameters.go @@ -40,51 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollOttCaParams creates a new EnrollOttCaParams object -// with the default values initialized. +// 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 { - var () return &EnrollOttCaParams{ - timeout: cr.DefaultTimeout, } } // NewEnrollOttCaParamsWithTimeout creates a new EnrollOttCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnrollOttCaParamsWithTimeout(timeout time.Duration) *EnrollOttCaParams { - var () return &EnrollOttCaParams{ - timeout: timeout, } } // NewEnrollOttCaParamsWithContext creates a new EnrollOttCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnrollOttCaParamsWithContext(ctx context.Context) *EnrollOttCaParams { - var () return &EnrollOttCaParams{ - Context: ctx, } } // NewEnrollOttCaParamsWithHTTPClient creates a new EnrollOttCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnrollOttCaParamsWithHTTPClient(client *http.Client) *EnrollOttCaParams { - var () 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 +/* 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*/ + // Token. + // + // Format: uuid Token strfmt.UUID timeout time.Duration @@ -92,6 +93,21 @@ type EnrollOttCaParams struct { 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) @@ -148,6 +164,7 @@ func (o *EnrollOttCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R qrToken := o.Token qToken := qrToken.String() if qToken != "" { + if err := r.SetQueryParam("token", qToken); err != nil { return err } diff --git a/rest_client/enroll/enroll_ott_ca_responses.go b/rest_client_api_client/enroll/enroll_ott_ca_responses.go similarity index 96% rename from rest_client/enroll/enroll_ott_ca_responses.go rename to rest_client_api_client/enroll/enroll_ott_ca_responses.go index 83d5fdb58..162fceb7b 100644 --- a/rest_client/enroll/enroll_ott_ca_responses.go +++ b/rest_client_api_client/enroll/enroll_ott_ca_responses.go @@ -53,7 +53,6 @@ func (o *EnrollOttCaReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -64,7 +63,7 @@ func NewEnrollOttCaOK() *EnrollOttCaOK { return &EnrollOttCaOK{} } -/*EnrollOttCaOK handles this case with default header values. +/* EnrollOttCaOK describes a response with status code 200, with default header values. Base empty response */ @@ -75,7 +74,6 @@ type EnrollOttCaOK struct { 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 } diff --git a/rest_client/enroll/enroll_ott_parameters.go b/rest_client_api_client/enroll/enroll_ott_parameters.go similarity index 77% rename from rest_client/enroll/enroll_ott_parameters.go rename to rest_client_api_client/enroll/enroll_ott_parameters.go index ff7c05766..ed66047a7 100644 --- a/rest_client/enroll/enroll_ott_parameters.go +++ b/rest_client_api_client/enroll/enroll_ott_parameters.go @@ -40,51 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollOttParams creates a new EnrollOttParams object -// with the default values initialized. +// 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 { - var () return &EnrollOttParams{ - timeout: cr.DefaultTimeout, } } // NewEnrollOttParamsWithTimeout creates a new EnrollOttParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnrollOttParamsWithTimeout(timeout time.Duration) *EnrollOttParams { - var () return &EnrollOttParams{ - timeout: timeout, } } // NewEnrollOttParamsWithContext creates a new EnrollOttParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnrollOttParamsWithContext(ctx context.Context) *EnrollOttParams { - var () return &EnrollOttParams{ - Context: ctx, } } // NewEnrollOttParamsWithHTTPClient creates a new EnrollOttParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnrollOttParamsWithHTTPClient(client *http.Client) *EnrollOttParams { - var () 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 +/* 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*/ + // Token. + // + // Format: uuid Token strfmt.UUID timeout time.Duration @@ -92,6 +93,21 @@ type EnrollOttParams struct { 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) @@ -148,6 +164,7 @@ func (o *EnrollOttParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg qrToken := o.Token qToken := qrToken.String() if qToken != "" { + if err := r.SetQueryParam("token", qToken); err != nil { return err } diff --git a/rest_client/enroll/enroll_ott_responses.go b/rest_client_api_client/enroll/enroll_ott_responses.go similarity index 95% rename from rest_client/enroll/enroll_ott_responses.go rename to rest_client_api_client/enroll/enroll_ott_responses.go index a016b0abd..872567094 100644 --- a/rest_client/enroll/enroll_ott_responses.go +++ b/rest_client_api_client/enroll/enroll_ott_responses.go @@ -59,7 +59,6 @@ func (o *EnrollOttReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -70,7 +69,7 @@ func NewEnrollOttOK() *EnrollOttOK { return &EnrollOttOK{} } -/*EnrollOttOK handles this case with default header values. +/* EnrollOttOK describes a response with status code 200, with default header values. A PEM encoded certificate signed by the internal Ziti CA */ @@ -81,7 +80,6 @@ type EnrollOttOK struct { 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 } @@ -101,7 +99,7 @@ func NewEnrollOttNotFound() *EnrollOttNotFound { return &EnrollOttNotFound{} } -/*EnrollOttNotFound handles this case with default header values. +/* EnrollOttNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -112,7 +110,6 @@ type EnrollOttNotFound struct { 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 } diff --git a/rest_client/enroll/enroll_parameters.go b/rest_client_api_client/enroll/enroll_parameters.go similarity index 78% rename from rest_client/enroll/enroll_parameters.go rename to rest_client_api_client/enroll/enroll_parameters.go index e37d7ff52..3bf4cad52 100644 --- a/rest_client/enroll/enroll_parameters.go +++ b/rest_client_api_client/enroll/enroll_parameters.go @@ -40,51 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewEnrollParams creates a new EnrollParams object -// with the default values initialized. +// 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 { - var () return &EnrollParams{ - timeout: cr.DefaultTimeout, } } // NewEnrollParamsWithTimeout creates a new EnrollParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewEnrollParamsWithTimeout(timeout time.Duration) *EnrollParams { - var () return &EnrollParams{ - timeout: timeout, } } // NewEnrollParamsWithContext creates a new EnrollParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewEnrollParamsWithContext(ctx context.Context) *EnrollParams { - var () return &EnrollParams{ - Context: ctx, } } // NewEnrollParamsWithHTTPClient creates a new EnrollParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewEnrollParamsWithHTTPClient(client *http.Client) *EnrollParams { - var () 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 +/* 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*/ + // Token. + // + // Format: uuid Token *strfmt.UUID timeout time.Duration @@ -92,6 +93,21 @@ type EnrollParams struct { 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) @@ -148,16 +164,17 @@ func (o *EnrollParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist // 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 { diff --git a/rest_client/enroll/enroll_responses.go b/rest_client_api_client/enroll/enroll_responses.go similarity index 95% rename from rest_client/enroll/enroll_responses.go rename to rest_client_api_client/enroll/enroll_responses.go index d462d9c0f..1a5fd5e0f 100644 --- a/rest_client/enroll/enroll_responses.go +++ b/rest_client_api_client/enroll/enroll_responses.go @@ -59,7 +59,6 @@ func (o *EnrollReader) ReadResponse(response runtime.ClientResponse, consumer ru 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()) } @@ -70,7 +69,7 @@ func NewEnrollOK() *EnrollOK { return &EnrollOK{} } -/*EnrollOK handles this case with default header values. +/* EnrollOK describes a response with status code 200, with default header values. Base empty response */ @@ -81,7 +80,6 @@ type EnrollOK struct { 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 } @@ -103,7 +101,7 @@ func NewEnrollNotFound() *EnrollNotFound { return &EnrollNotFound{} } -/*EnrollNotFound handles this case with default header values. +/* EnrollNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -114,7 +112,6 @@ type EnrollNotFound struct { 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 } diff --git a/rest_client/enroll/ernoll_updb_parameters.go b/rest_client_api_client/enroll/ernoll_updb_parameters.go similarity index 77% rename from rest_client/enroll/ernoll_updb_parameters.go rename to rest_client_api_client/enroll/ernoll_updb_parameters.go index 8fdda9cb2..d0af1d32b 100644 --- a/rest_client/enroll/ernoll_updb_parameters.go +++ b/rest_client_api_client/enroll/ernoll_updb_parameters.go @@ -40,51 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewErnollUpdbParams creates a new ErnollUpdbParams object -// with the default values initialized. +// 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 { - var () return &ErnollUpdbParams{ - timeout: cr.DefaultTimeout, } } // NewErnollUpdbParamsWithTimeout creates a new ErnollUpdbParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewErnollUpdbParamsWithTimeout(timeout time.Duration) *ErnollUpdbParams { - var () return &ErnollUpdbParams{ - timeout: timeout, } } // NewErnollUpdbParamsWithContext creates a new ErnollUpdbParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewErnollUpdbParamsWithContext(ctx context.Context) *ErnollUpdbParams { - var () return &ErnollUpdbParams{ - Context: ctx, } } // NewErnollUpdbParamsWithHTTPClient creates a new ErnollUpdbParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewErnollUpdbParamsWithHTTPClient(client *http.Client) *ErnollUpdbParams { - var () 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 +/* 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*/ + // Token. + // + // Format: uuid Token strfmt.UUID timeout time.Duration @@ -92,6 +93,21 @@ type ErnollUpdbParams struct { 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) @@ -148,6 +164,7 @@ func (o *ErnollUpdbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re qrToken := o.Token qToken := qrToken.String() if qToken != "" { + if err := r.SetQueryParam("token", qToken); err != nil { return err } diff --git a/rest_client/enroll/ernoll_updb_responses.go b/rest_client_api_client/enroll/ernoll_updb_responses.go similarity index 95% rename from rest_client/enroll/ernoll_updb_responses.go rename to rest_client_api_client/enroll/ernoll_updb_responses.go index 0d4f0fadd..136f4bf1d 100644 --- a/rest_client/enroll/ernoll_updb_responses.go +++ b/rest_client_api_client/enroll/ernoll_updb_responses.go @@ -59,7 +59,6 @@ func (o *ErnollUpdbReader) ReadResponse(response runtime.ClientResponse, consume 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()) } @@ -70,7 +69,7 @@ func NewErnollUpdbOK() *ErnollUpdbOK { return &ErnollUpdbOK{} } -/*ErnollUpdbOK handles this case with default header values. +/* ErnollUpdbOK describes a response with status code 200, with default header values. Base empty response */ @@ -81,7 +80,6 @@ type ErnollUpdbOK struct { 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 } @@ -103,7 +101,7 @@ func NewErnollUpdbNotFound() *ErnollUpdbNotFound { return &ErnollUpdbNotFound{} } -/*ErnollUpdbNotFound handles this case with default header values. +/* ErnollUpdbNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -114,7 +112,6 @@ type ErnollUpdbNotFound struct { 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 } diff --git a/rest_client/enroll/extend_router_enrollment_parameters.go b/rest_client_api_client/enroll/extend_router_enrollment_parameters.go similarity index 80% rename from rest_client/enroll/extend_router_enrollment_parameters.go rename to rest_client_api_client/enroll/extend_router_enrollment_parameters.go index 55a494b0c..6859382d8 100644 --- a/rest_client/enroll/extend_router_enrollment_parameters.go +++ b/rest_client_api_client/enroll/extend_router_enrollment_parameters.go @@ -42,51 +42,50 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewExtendRouterEnrollmentParams creates a new ExtendRouterEnrollmentParams object -// with the default values initialized. +// 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 { - var () return &ExtendRouterEnrollmentParams{ - timeout: cr.DefaultTimeout, } } // NewExtendRouterEnrollmentParamsWithTimeout creates a new ExtendRouterEnrollmentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewExtendRouterEnrollmentParamsWithTimeout(timeout time.Duration) *ExtendRouterEnrollmentParams { - var () return &ExtendRouterEnrollmentParams{ - timeout: timeout, } } // NewExtendRouterEnrollmentParamsWithContext creates a new ExtendRouterEnrollmentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewExtendRouterEnrollmentParamsWithContext(ctx context.Context) *ExtendRouterEnrollmentParams { - var () return &ExtendRouterEnrollmentParams{ - Context: ctx, } } // NewExtendRouterEnrollmentParamsWithHTTPClient creates a new ExtendRouterEnrollmentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewExtendRouterEnrollmentParamsWithHTTPClient(client *http.Client) *ExtendRouterEnrollmentParams { - var () 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 +/* 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. RouterExtendEnrollmentRequest *rest_model.RouterExtendEnrollmentRequest timeout time.Duration @@ -94,6 +93,21 @@ type ExtendRouterEnrollmentParams struct { 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) @@ -145,7 +159,6 @@ func (o *ExtendRouterEnrollmentParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.RouterExtendEnrollmentRequest != nil { if err := r.SetBodyParam(o.RouterExtendEnrollmentRequest); err != nil { return err diff --git a/rest_client/enroll/extend_router_enrollment_responses.go b/rest_client_api_client/enroll/extend_router_enrollment_responses.go similarity index 95% rename from rest_client/enroll/extend_router_enrollment_responses.go rename to rest_client_api_client/enroll/extend_router_enrollment_responses.go index a99d71a94..fee711d4e 100644 --- a/rest_client/enroll/extend_router_enrollment_responses.go +++ b/rest_client_api_client/enroll/extend_router_enrollment_responses.go @@ -59,7 +59,6 @@ func (o *ExtendRouterEnrollmentReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -70,7 +69,7 @@ func NewExtendRouterEnrollmentOK() *ExtendRouterEnrollmentOK { return &ExtendRouterEnrollmentOK{} } -/*ExtendRouterEnrollmentOK handles this case with default header values. +/* 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). */ @@ -81,7 +80,6 @@ type ExtendRouterEnrollmentOK struct { 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 } @@ -103,7 +101,7 @@ func NewExtendRouterEnrollmentUnauthorized() *ExtendRouterEnrollmentUnauthorized return &ExtendRouterEnrollmentUnauthorized{} } -/*ExtendRouterEnrollmentUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ExtendRouterEnrollmentUnauthorized struct { 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 } diff --git a/rest_client/informational/detail_spec_body_parameters.go b/rest_client_api_client/informational/detail_spec_body_parameters.go similarity index 78% rename from rest_client/informational/detail_spec_body_parameters.go rename to rest_client_api_client/informational/detail_spec_body_parameters.go index 34d1513bd..a768602e0 100644 --- a/rest_client/informational/detail_spec_body_parameters.go +++ b/rest_client_api_client/informational/detail_spec_body_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailSpecBodyParams creates a new DetailSpecBodyParams object -// with the default values initialized. +// 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 { - var () return &DetailSpecBodyParams{ - timeout: cr.DefaultTimeout, } } // NewDetailSpecBodyParamsWithTimeout creates a new DetailSpecBodyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailSpecBodyParamsWithTimeout(timeout time.Duration) *DetailSpecBodyParams { - var () return &DetailSpecBodyParams{ - timeout: timeout, } } // NewDetailSpecBodyParamsWithContext creates a new DetailSpecBodyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailSpecBodyParamsWithContext(ctx context.Context) *DetailSpecBodyParams { - var () return &DetailSpecBodyParams{ - Context: ctx, } } // NewDetailSpecBodyParamsWithHTTPClient creates a new DetailSpecBodyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailSpecBodyParamsWithHTTPClient(client *http.Client) *DetailSpecBodyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailSpecBodyParams struct { 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) diff --git a/rest_client/informational/detail_spec_body_responses.go b/rest_client_api_client/informational/detail_spec_body_responses.go similarity index 96% rename from rest_client/informational/detail_spec_body_responses.go rename to rest_client_api_client/informational/detail_spec_body_responses.go index 39126c27a..d75a9dea5 100644 --- a/rest_client/informational/detail_spec_body_responses.go +++ b/rest_client_api_client/informational/detail_spec_body_responses.go @@ -53,7 +53,6 @@ func (o *DetailSpecBodyReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -64,7 +63,7 @@ func NewDetailSpecBodyOK() *DetailSpecBodyOK { return &DetailSpecBodyOK{} } -/*DetailSpecBodyOK handles this case with default header values. +/* DetailSpecBodyOK describes a response with status code 200, with default header values. Returns the document that represents the specification */ @@ -75,7 +74,6 @@ type DetailSpecBodyOK struct { 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 } diff --git a/rest_client/informational/detail_spec_parameters.go b/rest_client_api_client/informational/detail_spec_parameters.go similarity index 77% rename from rest_client/informational/detail_spec_parameters.go rename to rest_client_api_client/informational/detail_spec_parameters.go index 49f716da7..1d39ca6c4 100644 --- a/rest_client/informational/detail_spec_parameters.go +++ b/rest_client_api_client/informational/detail_spec_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailSpecParams creates a new DetailSpecParams object -// with the default values initialized. +// 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 { - var () return &DetailSpecParams{ - timeout: cr.DefaultTimeout, } } // NewDetailSpecParamsWithTimeout creates a new DetailSpecParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailSpecParamsWithTimeout(timeout time.Duration) *DetailSpecParams { - var () return &DetailSpecParams{ - timeout: timeout, } } // NewDetailSpecParamsWithContext creates a new DetailSpecParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailSpecParamsWithContext(ctx context.Context) *DetailSpecParams { - var () return &DetailSpecParams{ - Context: ctx, } } // NewDetailSpecParamsWithHTTPClient creates a new DetailSpecParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailSpecParamsWithHTTPClient(client *http.Client) *DetailSpecParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailSpecParams struct { 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) diff --git a/rest_client/informational/detail_spec_responses.go b/rest_client_api_client/informational/detail_spec_responses.go similarity index 96% rename from rest_client/informational/detail_spec_responses.go rename to rest_client_api_client/informational/detail_spec_responses.go index f916065ce..fef793331 100644 --- a/rest_client/informational/detail_spec_responses.go +++ b/rest_client_api_client/informational/detail_spec_responses.go @@ -53,7 +53,6 @@ func (o *DetailSpecReader) ReadResponse(response runtime.ClientResponse, consume 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()) } @@ -64,7 +63,7 @@ func NewDetailSpecOK() *DetailSpecOK { return &DetailSpecOK{} } -/*DetailSpecOK handles this case with default header values. +/* DetailSpecOK describes a response with status code 200, with default header values. A single specification */ @@ -75,7 +74,6 @@ type DetailSpecOK struct { 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 } diff --git a/rest_client_api_client/informational/informational_client.go b/rest_client_api_client/informational/informational_client.go new file mode 100644 index 000000000..7933a2583 --- /dev/null +++ b/rest_client_api_client/informational/informational_client.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/informational/list_protocols_parameters.go b/rest_client_api_client/informational/list_protocols_parameters.go similarity index 77% rename from rest_client/informational/list_protocols_parameters.go rename to rest_client_api_client/informational/list_protocols_parameters.go index 54184a024..7489cb97f 100644 --- a/rest_client/informational/list_protocols_parameters.go +++ b/rest_client_api_client/informational/list_protocols_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListProtocolsParams creates a new ListProtocolsParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListProtocolsParams struct { 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) diff --git a/rest_client/informational/list_protocols_responses.go b/rest_client_api_client/informational/list_protocols_responses.go similarity index 96% rename from rest_client/informational/list_protocols_responses.go rename to rest_client_api_client/informational/list_protocols_responses.go index 438f53f26..282e9a4f0 100644 --- a/rest_client/informational/list_protocols_responses.go +++ b/rest_client_api_client/informational/list_protocols_responses.go @@ -53,7 +53,6 @@ func (o *ListProtocolsReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -64,7 +63,7 @@ func NewListProtocolsOK() *ListProtocolsOK { return &ListProtocolsOK{} } -/*ListProtocolsOK handles this case with default header values. +/* ListProtocolsOK describes a response with status code 200, with default header values. A list of supported Edge protocols */ @@ -75,7 +74,6 @@ type ListProtocolsOK struct { 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 } diff --git a/rest_client/informational/list_root_parameters.go b/rest_client_api_client/informational/list_root_parameters.go similarity index 76% rename from rest_client/informational/list_root_parameters.go rename to rest_client_api_client/informational/list_root_parameters.go index 44e862944..b614f3fdb 100644 --- a/rest_client/informational/list_root_parameters.go +++ b/rest_client_api_client/informational/list_root_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListRootParams creates a new ListRootParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListRootParams struct { 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) diff --git a/rest_client/informational/list_root_responses.go b/rest_client_api_client/informational/list_root_responses.go similarity index 96% rename from rest_client/informational/list_root_responses.go rename to rest_client_api_client/informational/list_root_responses.go index 65746d3f2..4df8c49e7 100644 --- a/rest_client/informational/list_root_responses.go +++ b/rest_client_api_client/informational/list_root_responses.go @@ -53,7 +53,6 @@ func (o *ListRootReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -64,7 +63,7 @@ func NewListRootOK() *ListRootOK { return &ListRootOK{} } -/*ListRootOK handles this case with default header values. +/* ListRootOK describes a response with status code 200, with default header values. Version information for the controller */ @@ -75,7 +74,6 @@ type ListRootOK struct { 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 } diff --git a/rest_client/informational/list_specs_parameters.go b/rest_client_api_client/informational/list_specs_parameters.go similarity index 76% rename from rest_client/informational/list_specs_parameters.go rename to rest_client_api_client/informational/list_specs_parameters.go index 93f808fd4..ebaa0b8be 100644 --- a/rest_client/informational/list_specs_parameters.go +++ b/rest_client_api_client/informational/list_specs_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSpecsParams creates a new ListSpecsParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListSpecsParams struct { 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) diff --git a/rest_client/informational/list_specs_responses.go b/rest_client_api_client/informational/list_specs_responses.go similarity index 96% rename from rest_client/informational/list_specs_responses.go rename to rest_client_api_client/informational/list_specs_responses.go index 88c5408ed..fa392d324 100644 --- a/rest_client/informational/list_specs_responses.go +++ b/rest_client_api_client/informational/list_specs_responses.go @@ -53,7 +53,6 @@ func (o *ListSpecsReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -64,7 +63,7 @@ func NewListSpecsOK() *ListSpecsOK { return &ListSpecsOK{} } -/*ListSpecsOK handles this case with default header values. +/* ListSpecsOK describes a response with status code 200, with default header values. A list of specifications */ @@ -75,7 +74,6 @@ type ListSpecsOK struct { 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 } diff --git a/rest_client/informational/list_version_parameters.go b/rest_client_api_client/informational/list_version_parameters.go similarity index 76% rename from rest_client/informational/list_version_parameters.go rename to rest_client_api_client/informational/list_version_parameters.go index abfd3e0da..77c18127a 100644 --- a/rest_client/informational/list_version_parameters.go +++ b/rest_client_api_client/informational/list_version_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListVersionParams creates a new ListVersionParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListVersionParams struct { 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) diff --git a/rest_client/informational/list_version_responses.go b/rest_client_api_client/informational/list_version_responses.go similarity index 96% rename from rest_client/informational/list_version_responses.go rename to rest_client_api_client/informational/list_version_responses.go index d1de5abb0..d1523fce3 100644 --- a/rest_client/informational/list_version_responses.go +++ b/rest_client_api_client/informational/list_version_responses.go @@ -53,7 +53,6 @@ func (o *ListVersionReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -64,7 +63,7 @@ func NewListVersionOK() *ListVersionOK { return &ListVersionOK{} } -/*ListVersionOK handles this case with default header values. +/* ListVersionOK describes a response with status code 200, with default header values. Version information for the controller */ @@ -75,7 +74,6 @@ type ListVersionOK struct { 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 } diff --git a/rest_client/posture_checks/create_posture_response_bulk_parameters.go b/rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go similarity index 79% rename from rest_client/posture_checks/create_posture_response_bulk_parameters.go rename to rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go index d86784054..6f2c6861e 100644 --- a/rest_client/posture_checks/create_posture_response_bulk_parameters.go +++ b/rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreatePostureResponseBulkParams creates a new CreatePostureResponseBulkParams object -// with the default values initialized. +// 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 { - var () return &CreatePostureResponseBulkParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePostureResponseBulkParamsWithTimeout creates a new CreatePostureResponseBulkParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePostureResponseBulkParamsWithTimeout(timeout time.Duration) *CreatePostureResponseBulkParams { - var () return &CreatePostureResponseBulkParams{ - timeout: timeout, } } // NewCreatePostureResponseBulkParamsWithContext creates a new CreatePostureResponseBulkParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePostureResponseBulkParamsWithContext(ctx context.Context) *CreatePostureResponseBulkParams { - var () return &CreatePostureResponseBulkParams{ - Context: ctx, } } // NewCreatePostureResponseBulkParamsWithHTTPClient creates a new CreatePostureResponseBulkParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePostureResponseBulkParamsWithHTTPClient(client *http.Client) *CreatePostureResponseBulkParams { - var () 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 +/* 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. + A Posture Response */ PostureResponse []rest_model.PostureResponseCreate @@ -97,6 +96,21 @@ type CreatePostureResponseBulkParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreatePostureResponseBulkParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.PostureResponse != nil { if err := r.SetBodyParam(o.PostureResponse); err != nil { return err diff --git a/rest_client/posture_checks/create_posture_response_bulk_responses.go b/rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go similarity index 94% rename from rest_client/posture_checks/create_posture_response_bulk_responses.go rename to rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go index c9d024305..597c7dc7d 100644 --- a/rest_client/posture_checks/create_posture_response_bulk_responses.go +++ b/rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go @@ -65,7 +65,6 @@ func (o *CreatePostureResponseBulkReader) ReadResponse(response runtime.ClientRe 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()) } @@ -76,7 +75,7 @@ func NewCreatePostureResponseBulkOK() *CreatePostureResponseBulkOK { return &CreatePostureResponseBulkOK{} } -/*CreatePostureResponseBulkOK handles this case with default header values. +/* CreatePostureResponseBulkOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type CreatePostureResponseBulkOK struct { func (o *CreatePostureResponseBulkOK) Error() string { return fmt.Sprintf("[POST /posture-response-bulk][%d] createPostureResponseBulkOK %+v", 200, o.Payload) } - func (o *CreatePostureResponseBulkOK) GetPayload() *rest_model.Empty { return o.Payload } @@ -109,7 +107,7 @@ func NewCreatePostureResponseBulkBadRequest() *CreatePostureResponseBulkBadReque return &CreatePostureResponseBulkBadRequest{} } -/*CreatePostureResponseBulkBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreatePostureResponseBulkBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreatePostureResponseBulkUnauthorized() *CreatePostureResponseBulkUnauth return &CreatePostureResponseBulkUnauthorized{} } -/*CreatePostureResponseBulkUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreatePostureResponseBulkUnauthorized struct { 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 } diff --git a/rest_client/posture_checks/create_posture_response_parameters.go b/rest_client_api_client/posture_checks/create_posture_response_parameters.go similarity index 79% rename from rest_client/posture_checks/create_posture_response_parameters.go rename to rest_client_api_client/posture_checks/create_posture_response_parameters.go index 239aff6a6..b6f84b13b 100644 --- a/rest_client/posture_checks/create_posture_response_parameters.go +++ b/rest_client_api_client/posture_checks/create_posture_response_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreatePostureResponseParams creates a new CreatePostureResponseParams object -// with the default values initialized. +// 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 { - var () return &CreatePostureResponseParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePostureResponseParamsWithTimeout creates a new CreatePostureResponseParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePostureResponseParamsWithTimeout(timeout time.Duration) *CreatePostureResponseParams { - var () return &CreatePostureResponseParams{ - timeout: timeout, } } // NewCreatePostureResponseParamsWithContext creates a new CreatePostureResponseParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePostureResponseParamsWithContext(ctx context.Context) *CreatePostureResponseParams { - var () return &CreatePostureResponseParams{ - Context: ctx, } } // NewCreatePostureResponseParamsWithHTTPClient creates a new CreatePostureResponseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePostureResponseParamsWithHTTPClient(client *http.Client) *CreatePostureResponseParams { - var () 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 +/* 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. + A Posture Response */ PostureResponse rest_model.PostureResponseCreate @@ -97,6 +96,21 @@ type CreatePostureResponseParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreatePostureResponseParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.PostureResponse); err != nil { return err } diff --git a/rest_client/posture_checks/create_posture_response_responses.go b/rest_client_api_client/posture_checks/create_posture_response_responses.go similarity index 94% rename from rest_client/posture_checks/create_posture_response_responses.go rename to rest_client_api_client/posture_checks/create_posture_response_responses.go index b313c5b95..fb661241e 100644 --- a/rest_client/posture_checks/create_posture_response_responses.go +++ b/rest_client_api_client/posture_checks/create_posture_response_responses.go @@ -65,7 +65,6 @@ func (o *CreatePostureResponseReader) ReadResponse(response runtime.ClientRespon 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()) } @@ -76,7 +75,7 @@ func NewCreatePostureResponseCreated() *CreatePostureResponseCreated { return &CreatePostureResponseCreated{} } -/*CreatePostureResponseCreated handles this case with default header values. +/* CreatePostureResponseCreated 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 */ @@ -87,7 +86,6 @@ type CreatePostureResponseCreated struct { func (o *CreatePostureResponseCreated) Error() string { return fmt.Sprintf("[POST /posture-response][%d] createPostureResponseCreated %+v", 201, o.Payload) } - func (o *CreatePostureResponseCreated) GetPayload() *rest_model.CreateEnvelope { return o.Payload } @@ -109,7 +107,7 @@ func NewCreatePostureResponseBadRequest() *CreatePostureResponseBadRequest { return &CreatePostureResponseBadRequest{} } -/*CreatePostureResponseBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreatePostureResponseBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreatePostureResponseUnauthorized() *CreatePostureResponseUnauthorized { return &CreatePostureResponseUnauthorized{} } -/*CreatePostureResponseUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreatePostureResponseUnauthorized struct { 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 } diff --git a/rest_client_api_client/posture_checks/posture_checks_client.go b/rest_client_api_client/posture_checks/posture_checks_client.go new file mode 100644 index 000000000..85196ac25 --- /dev/null +++ b/rest_client_api_client/posture_checks/posture_checks_client.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/service/delete_service_parameters.go b/rest_client_api_client/service/delete_service_parameters.go similarity index 78% rename from rest_client/service/delete_service_parameters.go rename to rest_client_api_client/service/delete_service_parameters.go index 9ca4cce15..e4381338c 100644 --- a/rest_client/service/delete_service_parameters.go +++ b/rest_client_api_client/service/delete_service_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteServiceParams creates a new DeleteServiceParams object -// with the default values initialized. +// 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 { - var () return &DeleteServiceParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteServiceParamsWithTimeout creates a new DeleteServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteServiceParamsWithTimeout(timeout time.Duration) *DeleteServiceParams { - var () return &DeleteServiceParams{ - timeout: timeout, } } // NewDeleteServiceParamsWithContext creates a new DeleteServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteServiceParamsWithContext(ctx context.Context) *DeleteServiceParams { - var () return &DeleteServiceParams{ - Context: ctx, } } // NewDeleteServiceParamsWithHTTPClient creates a new DeleteServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteServiceParamsWithHTTPClient(client *http.Client) *DeleteServiceParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteServiceParams struct { 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) diff --git a/rest_client/service/delete_service_responses.go b/rest_client_api_client/service/delete_service_responses.go similarity index 94% rename from rest_client/service/delete_service_responses.go rename to rest_client_api_client/service/delete_service_responses.go index 22fa3fcd4..329afe930 100644 --- a/rest_client/service/delete_service_responses.go +++ b/rest_client_api_client/service/delete_service_responses.go @@ -71,7 +71,6 @@ func (o *DeleteServiceReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -82,7 +81,7 @@ func NewDeleteServiceOK() *DeleteServiceOK { return &DeleteServiceOK{} } -/*DeleteServiceOK handles this case with default header values. +/* DeleteServiceOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteServiceOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteServiceBadRequest() *DeleteServiceBadRequest { return &DeleteServiceBadRequest{} } -/*DeleteServiceBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteServiceBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteServiceUnauthorized() *DeleteServiceUnauthorized { return &DeleteServiceUnauthorized{} } -/*DeleteServiceUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteServiceUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteServiceConflict() *DeleteServiceConflict { return &DeleteServiceConflict{} } -/*DeleteServiceConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteServiceConflict struct { 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 } diff --git a/rest_client/service/detail_service_parameters.go b/rest_client_api_client/service/detail_service_parameters.go similarity index 78% rename from rest_client/service/detail_service_parameters.go rename to rest_client_api_client/service/detail_service_parameters.go index 3e8fbf4e4..2b6d3bfc5 100644 --- a/rest_client/service/detail_service_parameters.go +++ b/rest_client_api_client/service/detail_service_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailServiceParams creates a new DetailServiceParams object -// with the default values initialized. +// 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 { - var () return &DetailServiceParams{ - timeout: cr.DefaultTimeout, } } // NewDetailServiceParamsWithTimeout creates a new DetailServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailServiceParamsWithTimeout(timeout time.Duration) *DetailServiceParams { - var () return &DetailServiceParams{ - timeout: timeout, } } // NewDetailServiceParamsWithContext creates a new DetailServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailServiceParamsWithContext(ctx context.Context) *DetailServiceParams { - var () return &DetailServiceParams{ - Context: ctx, } } // NewDetailServiceParamsWithHTTPClient creates a new DetailServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailServiceParamsWithHTTPClient(client *http.Client) *DetailServiceParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailServiceParams struct { 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) diff --git a/rest_client/service/detail_service_responses.go b/rest_client_api_client/service/detail_service_responses.go similarity index 94% rename from rest_client/service/detail_service_responses.go rename to rest_client_api_client/service/detail_service_responses.go index deab41209..5e74205aa 100644 --- a/rest_client/service/detail_service_responses.go +++ b/rest_client_api_client/service/detail_service_responses.go @@ -65,7 +65,6 @@ func (o *DetailServiceReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -76,7 +75,7 @@ func NewDetailServiceOK() *DetailServiceOK { return &DetailServiceOK{} } -/*DetailServiceOK handles this case with default header values. +/* DetailServiceOK describes a response with status code 200, with default header values. A single service */ @@ -87,7 +86,6 @@ type DetailServiceOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailServiceUnauthorized() *DetailServiceUnauthorized { return &DetailServiceUnauthorized{} } -/*DetailServiceUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailServiceUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailServiceNotFound() *DetailServiceNotFound { return &DetailServiceNotFound{} } -/*DetailServiceNotFound handles this case with default header values. +/* DetailServiceNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailServiceNotFound struct { 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 } diff --git a/rest_client/service/list_service_terminators_parameters.go b/rest_client_api_client/service/list_service_terminators_parameters.go similarity index 83% rename from rest_client/service/list_service_terminators_parameters.go rename to rest_client_api_client/service/list_service_terminators_parameters.go index d92cdc1af..61702324d 100644 --- a/rest_client/service/list_service_terminators_parameters.go +++ b/rest_client_api_client/service/list_service_terminators_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object -// with the default values initialized. +// 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 { - var () return &ListServiceTerminatorsParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceTerminatorsParamsWithTimeout creates a new ListServiceTerminatorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceTerminatorsParamsWithTimeout(timeout time.Duration) *ListServiceTerminatorsParams { - var () return &ListServiceTerminatorsParams{ - timeout: timeout, } } // NewListServiceTerminatorsParamsWithContext creates a new ListServiceTerminatorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceTerminatorsParamsWithContext(ctx context.Context) *ListServiceTerminatorsParams { - var () return &ListServiceTerminatorsParams{ - Context: ctx, } } // NewListServiceTerminatorsParamsWithHTTPClient creates a new ListServiceTerminatorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceTerminatorsParamsWithHTTPClient(client *http.Client) *ListServiceTerminatorsParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceTerminatorsParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceTerminatorsParams) WriteToRequest(r runtime.ClientRequest, r // 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 @@ -212,32 +230,34 @@ func (o *ListServiceTerminatorsParams) WriteToRequest(r runtime.ClientRequest, r // 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 { diff --git a/rest_client_api_client/service/list_service_terminators_responses.go b/rest_client_api_client/service/list_service_terminators_responses.go new file mode 100644 index 000000000..8c786a456 --- /dev/null +++ b/rest_client_api_client/service/list_service_terminators_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 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 +} + +// 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/service/list_services_parameters.go b/rest_client_api_client/service/list_services_parameters.go similarity index 77% rename from rest_client/service/list_services_parameters.go rename to rest_client_api_client/service/list_services_parameters.go index df0bec1b2..84c5ff824 100644 --- a/rest_client/service/list_services_parameters.go +++ b/rest_client_api_client/service/list_services_parameters.go @@ -41,59 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServicesParams creates a new ListServicesParams object -// with the default values initialized. +// 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 { - var () return &ListServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - var () return &ListServicesParams{ - timeout: timeout, } } // NewListServicesParamsWithContext creates a new ListServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - var () return &ListServicesParams{ - Context: ctx, } } // NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 - /*RoleFilter*/ + + // RoleFilter. RoleFilter []string - /*RoleSemantic*/ + + // RoleSemantic. RoleSemantic *string timeout time.Duration @@ -101,6 +104,21 @@ type ListServicesParams struct { 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) @@ -201,72 +219,79 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. // 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 } } - } - valuesRoleFilter := o.RoleFilter + if o.RoleFilter != nil { - joinedRoleFilter := swag.JoinByFormat(valuesRoleFilter, "multi") - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err + // 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 { @@ -274,3 +299,20 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } 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/service/list_services_responses.go b/rest_client_api_client/service/list_services_responses.go similarity index 95% rename from rest_client/service/list_services_responses.go rename to rest_client_api_client/service/list_services_responses.go index d32d80f96..f376ad677 100644 --- a/rest_client/service/list_services_responses.go +++ b/rest_client_api_client/service/list_services_responses.go @@ -59,7 +59,6 @@ func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -70,7 +69,7 @@ func NewListServicesOK() *ListServicesOK { return &ListServicesOK{} } -/*ListServicesOK handles this case with default header values. +/* ListServicesOK describes a response with status code 200, with default header values. A list of services */ @@ -81,7 +80,6 @@ type ListServicesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServicesUnauthorized() *ListServicesUnauthorized { return &ListServicesUnauthorized{} } -/*ListServicesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServicesUnauthorized struct { 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 } diff --git a/rest_client/service/patch_service_parameters.go b/rest_client_api_client/service/patch_service_parameters.go similarity index 79% rename from rest_client/service/patch_service_parameters.go rename to rest_client_api_client/service/patch_service_parameters.go index 237aeb449..7b024e750 100644 --- a/rest_client/service/patch_service_parameters.go +++ b/rest_client_api_client/service/patch_service_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchServiceParams creates a new PatchServiceParams object -// with the default values initialized. +// 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 { - var () return &PatchServiceParams{ - timeout: cr.DefaultTimeout, } } // NewPatchServiceParamsWithTimeout creates a new PatchServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchServiceParamsWithTimeout(timeout time.Duration) *PatchServiceParams { - var () return &PatchServiceParams{ - timeout: timeout, } } // NewPatchServiceParamsWithContext creates a new PatchServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchServiceParamsWithContext(ctx context.Context) *PatchServiceParams { - var () return &PatchServiceParams{ - Context: ctx, } } // NewPatchServiceParamsWithHTTPClient creates a new PatchServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchServiceParamsWithHTTPClient(client *http.Client) *PatchServiceParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Service - A service patch object + /* Service. + + A service patch object */ Service *rest_model.ServicePatch @@ -102,6 +102,21 @@ type PatchServiceParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. 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 diff --git a/rest_client/service/patch_service_responses.go b/rest_client_api_client/service/patch_service_responses.go similarity index 94% rename from rest_client/service/patch_service_responses.go rename to rest_client_api_client/service/patch_service_responses.go index d9861e6d7..799bc869e 100644 --- a/rest_client/service/patch_service_responses.go +++ b/rest_client_api_client/service/patch_service_responses.go @@ -71,7 +71,6 @@ func (o *PatchServiceReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -82,7 +81,7 @@ func NewPatchServiceOK() *PatchServiceOK { return &PatchServiceOK{} } -/*PatchServiceOK handles this case with default header values. +/* PatchServiceOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchServiceOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchServiceBadRequest() *PatchServiceBadRequest { return &PatchServiceBadRequest{} } -/*PatchServiceBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchServiceBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchServiceUnauthorized() *PatchServiceUnauthorized { return &PatchServiceUnauthorized{} } -/*PatchServiceUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchServiceUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchServiceNotFound() *PatchServiceNotFound { return &PatchServiceNotFound{} } -/*PatchServiceNotFound handles this case with default header values. +/* PatchServiceNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchServiceNotFound struct { 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 } diff --git a/rest_client_api_client/service/service_client.go b/rest_client_api_client/service/service_client.go new file mode 100644 index 000000000..225961c88 --- /dev/null +++ b/rest_client_api_client/service/service_client.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/service/update_service_parameters.go b/rest_client_api_client/service/update_service_parameters.go similarity index 79% rename from rest_client/service/update_service_parameters.go rename to rest_client_api_client/service/update_service_parameters.go index 9f65e3221..db16242d8 100644 --- a/rest_client/service/update_service_parameters.go +++ b/rest_client_api_client/service/update_service_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateServiceParams creates a new UpdateServiceParams object -// with the default values initialized. +// 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 { - var () return &UpdateServiceParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateServiceParamsWithTimeout creates a new UpdateServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateServiceParamsWithTimeout(timeout time.Duration) *UpdateServiceParams { - var () return &UpdateServiceParams{ - timeout: timeout, } } // NewUpdateServiceParamsWithContext creates a new UpdateServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateServiceParamsWithContext(ctx context.Context) *UpdateServiceParams { - var () return &UpdateServiceParams{ - Context: ctx, } } // NewUpdateServiceParamsWithHTTPClient creates a new UpdateServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateServiceParamsWithHTTPClient(client *http.Client) *UpdateServiceParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Service - A service update object + /* Service. + + A service update object */ Service *rest_model.ServiceUpdate @@ -102,6 +102,21 @@ type UpdateServiceParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt 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 diff --git a/rest_client/service/update_service_responses.go b/rest_client_api_client/service/update_service_responses.go similarity index 94% rename from rest_client/service/update_service_responses.go rename to rest_client_api_client/service/update_service_responses.go index f9ec20e6a..075c3ecdd 100644 --- a/rest_client/service/update_service_responses.go +++ b/rest_client_api_client/service/update_service_responses.go @@ -71,7 +71,6 @@ func (o *UpdateServiceReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -82,7 +81,7 @@ func NewUpdateServiceOK() *UpdateServiceOK { return &UpdateServiceOK{} } -/*UpdateServiceOK handles this case with default header values. +/* UpdateServiceOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateServiceOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateServiceBadRequest() *UpdateServiceBadRequest { return &UpdateServiceBadRequest{} } -/*UpdateServiceBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateServiceBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateServiceUnauthorized() *UpdateServiceUnauthorized { return &UpdateServiceUnauthorized{} } -/*UpdateServiceUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateServiceUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateServiceNotFound() *UpdateServiceNotFound { return &UpdateServiceNotFound{} } -/*UpdateServiceNotFound handles this case with default header values. +/* UpdateServiceNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateServiceNotFound struct { 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 } diff --git a/rest_client/session/create_session_parameters.go b/rest_client_api_client/session/create_session_parameters.go similarity index 79% rename from rest_client/session/create_session_parameters.go rename to rest_client_api_client/session/create_session_parameters.go index 54037ef8d..ec83a4496 100644 --- a/rest_client/session/create_session_parameters.go +++ b/rest_client_api_client/session/create_session_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateSessionParams creates a new CreateSessionParams object -// with the default values initialized. +// 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 { - var () return &CreateSessionParams{ - timeout: cr.DefaultTimeout, } } // NewCreateSessionParamsWithTimeout creates a new CreateSessionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateSessionParamsWithTimeout(timeout time.Duration) *CreateSessionParams { - var () return &CreateSessionParams{ - timeout: timeout, } } // NewCreateSessionParamsWithContext creates a new CreateSessionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateSessionParamsWithContext(ctx context.Context) *CreateSessionParams { - var () return &CreateSessionParams{ - Context: ctx, } } // NewCreateSessionParamsWithHTTPClient creates a new CreateSessionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateSessionParamsWithHTTPClient(client *http.Client) *CreateSessionParams { - var () 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 +/* 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. + A session to create */ Session *rest_model.SessionCreate @@ -97,6 +96,21 @@ type CreateSessionParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if o.Session != nil { if err := r.SetBodyParam(o.Session); err != nil { return err diff --git a/rest_client/session/create_session_responses.go b/rest_client_api_client/session/create_session_responses.go similarity index 94% rename from rest_client/session/create_session_responses.go rename to rest_client_api_client/session/create_session_responses.go index 36de039d0..040633acf 100644 --- a/rest_client/session/create_session_responses.go +++ b/rest_client_api_client/session/create_session_responses.go @@ -65,7 +65,6 @@ func (o *CreateSessionReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -76,7 +75,7 @@ func NewCreateSessionCreated() *CreateSessionCreated { return &CreateSessionCreated{} } -/*CreateSessionCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateSessionCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateSessionBadRequest() *CreateSessionBadRequest { return &CreateSessionBadRequest{} } -/*CreateSessionBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateSessionBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateSessionUnauthorized() *CreateSessionUnauthorized { return &CreateSessionUnauthorized{} } -/*CreateSessionUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateSessionUnauthorized struct { 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 } diff --git a/rest_client/session/delete_session_parameters.go b/rest_client_api_client/session/delete_session_parameters.go similarity index 78% rename from rest_client/session/delete_session_parameters.go rename to rest_client_api_client/session/delete_session_parameters.go index e2a04f425..911fb733a 100644 --- a/rest_client/session/delete_session_parameters.go +++ b/rest_client_api_client/session/delete_session_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteSessionParams creates a new DeleteSessionParams object -// with the default values initialized. +// 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 { - var () return &DeleteSessionParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteSessionParamsWithTimeout creates a new DeleteSessionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteSessionParamsWithTimeout(timeout time.Duration) *DeleteSessionParams { - var () return &DeleteSessionParams{ - timeout: timeout, } } // NewDeleteSessionParamsWithContext creates a new DeleteSessionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteSessionParamsWithContext(ctx context.Context) *DeleteSessionParams { - var () return &DeleteSessionParams{ - Context: ctx, } } // NewDeleteSessionParamsWithHTTPClient creates a new DeleteSessionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteSessionParamsWithHTTPClient(client *http.Client) *DeleteSessionParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteSessionParams struct { 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) diff --git a/rest_client/session/delete_session_responses.go b/rest_client_api_client/session/delete_session_responses.go similarity index 94% rename from rest_client/session/delete_session_responses.go rename to rest_client_api_client/session/delete_session_responses.go index 7857dd573..9c499e3a0 100644 --- a/rest_client/session/delete_session_responses.go +++ b/rest_client_api_client/session/delete_session_responses.go @@ -71,7 +71,6 @@ func (o *DeleteSessionReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -82,7 +81,7 @@ func NewDeleteSessionOK() *DeleteSessionOK { return &DeleteSessionOK{} } -/*DeleteSessionOK handles this case with default header values. +/* DeleteSessionOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteSessionOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteSessionBadRequest() *DeleteSessionBadRequest { return &DeleteSessionBadRequest{} } -/*DeleteSessionBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteSessionBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { return &DeleteSessionUnauthorized{} } -/*DeleteSessionUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteSessionUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteSessionConflict() *DeleteSessionConflict { return &DeleteSessionConflict{} } -/*DeleteSessionConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteSessionConflict struct { 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 } diff --git a/rest_client/session/detail_session_parameters.go b/rest_client_api_client/session/detail_session_parameters.go similarity index 78% rename from rest_client/session/detail_session_parameters.go rename to rest_client_api_client/session/detail_session_parameters.go index 9a145ea6b..d213be760 100644 --- a/rest_client/session/detail_session_parameters.go +++ b/rest_client_api_client/session/detail_session_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailSessionParams creates a new DetailSessionParams object -// with the default values initialized. +// 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 { - var () return &DetailSessionParams{ - timeout: cr.DefaultTimeout, } } // NewDetailSessionParamsWithTimeout creates a new DetailSessionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailSessionParamsWithTimeout(timeout time.Duration) *DetailSessionParams { - var () return &DetailSessionParams{ - timeout: timeout, } } // NewDetailSessionParamsWithContext creates a new DetailSessionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailSessionParamsWithContext(ctx context.Context) *DetailSessionParams { - var () return &DetailSessionParams{ - Context: ctx, } } // NewDetailSessionParamsWithHTTPClient creates a new DetailSessionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailSessionParamsWithHTTPClient(client *http.Client) *DetailSessionParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailSessionParams struct { 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) diff --git a/rest_client/session/detail_session_responses.go b/rest_client_api_client/session/detail_session_responses.go similarity index 94% rename from rest_client/session/detail_session_responses.go rename to rest_client_api_client/session/detail_session_responses.go index 42b1d8805..374ade674 100644 --- a/rest_client/session/detail_session_responses.go +++ b/rest_client_api_client/session/detail_session_responses.go @@ -65,7 +65,6 @@ func (o *DetailSessionReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -76,7 +75,7 @@ func NewDetailSessionOK() *DetailSessionOK { return &DetailSessionOK{} } -/*DetailSessionOK handles this case with default header values. +/* DetailSessionOK describes a response with status code 200, with default header values. A single session */ @@ -87,7 +86,6 @@ type DetailSessionOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailSessionUnauthorized() *DetailSessionUnauthorized { return &DetailSessionUnauthorized{} } -/*DetailSessionUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailSessionUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailSessionNotFound() *DetailSessionNotFound { return &DetailSessionNotFound{} } -/*DetailSessionNotFound handles this case with default header values. +/* DetailSessionNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailSessionNotFound struct { 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 } diff --git a/rest_client/session/list_sessions_parameters.go b/rest_client_api_client/session/list_sessions_parameters.go similarity index 83% rename from rest_client/session/list_sessions_parameters.go rename to rest_client_api_client/session/list_sessions_parameters.go index 28bef05db..377255fe2 100644 --- a/rest_client/session/list_sessions_parameters.go +++ b/rest_client_api_client/session/list_sessions_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListSessionsParams creates a new ListSessionsParams object -// with the default values initialized. +// 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 { - var () return &ListSessionsParams{ - timeout: cr.DefaultTimeout, } } // NewListSessionsParamsWithTimeout creates a new ListSessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListSessionsParamsWithTimeout(timeout time.Duration) *ListSessionsParams { - var () return &ListSessionsParams{ - timeout: timeout, } } // NewListSessionsParamsWithContext creates a new ListSessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListSessionsParamsWithContext(ctx context.Context) *ListSessionsParams { - var () return &ListSessionsParams{ - Context: ctx, } } // NewListSessionsParamsWithHTTPClient creates a new ListSessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListSessionsParamsWithHTTPClient(client *http.Client) *ListSessionsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListSessionsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. // 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 { diff --git a/rest_client/session/list_sessions_responses.go b/rest_client_api_client/session/list_sessions_responses.go similarity index 95% rename from rest_client/session/list_sessions_responses.go rename to rest_client_api_client/session/list_sessions_responses.go index a11dfcda4..a6ca7c0b3 100644 --- a/rest_client/session/list_sessions_responses.go +++ b/rest_client_api_client/session/list_sessions_responses.go @@ -59,7 +59,6 @@ func (o *ListSessionsReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -70,7 +69,7 @@ func NewListSessionsOK() *ListSessionsOK { return &ListSessionsOK{} } -/*ListSessionsOK handles this case with default header values. +/* ListSessionsOK describes a response with status code 200, with default header values. A list of sessions */ @@ -81,7 +80,6 @@ type ListSessionsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListSessionsUnauthorized() *ListSessionsUnauthorized { return &ListSessionsUnauthorized{} } -/*ListSessionsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListSessionsUnauthorized struct { 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 } diff --git a/rest_client_api_client/session/session_client.go b/rest_client_api_client/session/session_client.go new file mode 100644 index 000000000..d8e869d5d --- /dev/null +++ b/rest_client_api_client/session/session_client.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/well_known/list_well_known_cas_parameters.go b/rest_client_api_client/well_known/list_well_known_cas_parameters.go similarity index 77% rename from rest_client/well_known/list_well_known_cas_parameters.go rename to rest_client_api_client/well_known/list_well_known_cas_parameters.go index 67fc9c67c..70269b0fc 100644 --- a/rest_client/well_known/list_well_known_cas_parameters.go +++ b/rest_client_api_client/well_known/list_well_known_cas_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListWellKnownCasParams creates a new ListWellKnownCasParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListWellKnownCasParams struct { 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) diff --git a/rest_client/well_known/list_well_known_cas_responses.go b/rest_client_api_client/well_known/list_well_known_cas_responses.go similarity index 96% rename from rest_client/well_known/list_well_known_cas_responses.go rename to rest_client_api_client/well_known/list_well_known_cas_responses.go index 08e501eb6..7d1f79d6d 100644 --- a/rest_client/well_known/list_well_known_cas_responses.go +++ b/rest_client_api_client/well_known/list_well_known_cas_responses.go @@ -51,7 +51,6 @@ func (o *ListWellKnownCasReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -62,7 +61,7 @@ func NewListWellKnownCasOK() *ListWellKnownCasOK { return &ListWellKnownCasOK{} } -/*ListWellKnownCasOK handles this case with default header values. +/* ListWellKnownCasOK describes a response with status code 200, with default header values. A base64 encoded PKCS7 store */ @@ -73,7 +72,6 @@ type ListWellKnownCasOK struct { 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 } diff --git a/rest_client/well_known/well_known_client.go b/rest_client_api_client/well_known/well_known_client.go similarity index 89% rename from rest_client/well_known/well_known_client.go rename to rest_client_api_client/well_known/well_known_client.go index 41f59af8b..10b2d2782 100644 --- a/rest_client/well_known/well_known_client.go +++ b/rest_client_api_client/well_known/well_known_client.go @@ -49,9 +49,12 @@ type Client struct { 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) (*ListWellKnownCasOK, error) + ListWellKnownCas(params *ListWellKnownCasParams, opts ...ClientOption) (*ListWellKnownCasOK, error) SetTransport(transport runtime.ClientTransport) } @@ -64,13 +67,12 @@ This endpoint returns a base64 encoded PKCS7 store. The content can be base64 de that supports parsing PKCS7 stores. */ -func (a *Client) ListWellKnownCas(params *ListWellKnownCasParams) (*ListWellKnownCasOK, error) { +func (a *Client) ListWellKnownCas(params *ListWellKnownCasParams, opts ...ClientOption) (*ListWellKnownCasOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListWellKnownCasParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listWellKnownCas", Method: "GET", PathPattern: "/.well-known/est/cacerts", @@ -81,7 +83,12 @@ func (a *Client) ListWellKnownCas(params *ListWellKnownCasParams) (*ListWellKnow 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 } diff --git a/rest_client_api_client/ziti_edge_client_client.go b/rest_client_api_client/ziti_edge_client_client.go new file mode 100644 index 000000000..a0ffa1e35 --- /dev/null +++ b/rest_client_api_client/ziti_edge_client_client.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// 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/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.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 + + 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.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 new file mode 100644 index 000000000..3d581e3ff --- /dev/null +++ b/rest_client_api_server/configure_ziti_edge_client.go @@ -0,0 +1,377 @@ +// 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/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.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.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.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_server/doc.go b/rest_client_api_server/doc.go similarity index 91% rename from rest_server/doc.go rename to rest_client_api_server/doc.go index 4b1af7a33..22afda840 100644 --- a/rest_server/doc.go +++ b/rest_client_api_server/doc.go @@ -23,13 +23,13 @@ // __/ | // |___/ -// Package rest_server Ziti Edge +// Package rest_client_api_server Ziti Edge Client // // Schemes: // https // Host: demo.ziti.dev -// BasePath: /edge/v1 -// Version: 0.16.3 +// BasePath: /edge/client/v1 +// Version: 0.19.12 // Contact: // // Consumes: @@ -39,7 +39,6 @@ // - text/plain // // Produces: -// - application/jwt // - application/pkcs7-mime // - application/x-pem-file // - application/x-x509-user-cert @@ -48,4 +47,4 @@ // - text/yaml // // swagger:meta -package rest_server +package rest_client_api_server diff --git a/rest_client_api_server/embedded_spec.go b/rest_client_api_server/embedded_spec.go new file mode 100644 index 000000000..7fa4626cf --- /dev/null +++ b/rest_client_api_server/embedded_spec.go @@ -0,0 +1,10579 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// 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": { + "title": "Ziti Edge Client", + "contact": {}, + "version": "0.19.12" + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "enum": [ + "password", + "cert" + ], + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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 pased 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. 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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "token", + "in": "query", + "required": true + } + ] + }, + "/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": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "type": "string" + } + } + }, + "apiSessionDetail": { + "description": "An API Session object", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/baseEntity" + }, + { + "type": "object", + "required": [ + "token", + "identity", + "identityId", + "configTypes", + "ipAddress", + "authQueries", + "cachedUpdatedAt", + "isMfaRequired", + "isMfaComplete" + ], + "properties": { + "authQueries": { + "$ref": "#/definitions/authQueryList" + }, + "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": { + "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-omitempty": false + }, + "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", + "tags" + ], + "properties": { + "_links": { + "$ref": "#/definitions/links" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "commonEdgeRouterProperties": { + "type": "object", + "required": [ + "hostname", + "name", + "supportedProtocols", + "syncStatus", + "isOnline" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "hostname": { + "type": "string" + }, + "isOnline": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "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", + "error" + ], + "properties": { + "error": { + "$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" + } + } + }, + "updb": { + "type": "object", + "properties": { + "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" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "authenticators": { + "$ref": "#/definitions/identityAuthenticators" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "enrollment": { + "$ref": "#/definitions/identityEnrollments" + }, + "envInfo": { + "$ref": "#/definitions/envInfo" + }, + "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" + } + } + } + } + }, + "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" + } + } + }, + "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": { + "apiEnrolmentVersion": { + "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" + ] + }, + "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" + ], + "properties": { + "isPassing": { + "type": "boolean" + }, + "process": { + "$ref": "#/definitions/postureQueryProcess" + }, + "processes": { + "type": "array", + "items": { + "$ref": "#/definitions/postureQueryProcess" + } + }, + "queryType": { + "$ref": "#/definitions/postureCheckType" + }, + "timeout": { + "type": "integer" + } + } + } + ] + }, + "postureQueryProcess": { + "type": "object", + "properties": { + "osType": { + "$ref": "#/definitions/osType" + }, + "path": { + "type": "string" + } + } + }, + "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" + }, + "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" + }, + "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": { + "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": { + "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": { + "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" + ], + "properties": { + "apiSession": { + "$ref": "#/definitions/entityRef" + }, + "apiSessionId": { + "type": "string" + }, + "edgeRouters": { + "type": "array", + "items": { + "$ref": "#/definitions/sessionEdgeRouter" + } + }, + "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" + } + }, + "tags": { + "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "x-omitempty": false + }, + "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": { + "title": "Ziti Edge Client", + "contact": {}, + "version": "0.19.12" + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "enum": [ + "password", + "cert" + ], + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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 pased 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. 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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "token", + "in": "query", + "required": true + } + ] + }, + "/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": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + }, + "IdentityAuthenticatorsUpdb": { + "type": "object", + "properties": { + "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": { + "type": "string" + } + } + }, + "apiSessionDetail": { + "description": "An API Session object", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/baseEntity" + }, + { + "type": "object", + "required": [ + "token", + "identity", + "identityId", + "configTypes", + "ipAddress", + "authQueries", + "cachedUpdatedAt", + "isMfaRequired", + "isMfaComplete" + ], + "properties": { + "authQueries": { + "$ref": "#/definitions/authQueryList" + }, + "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": { + "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-omitempty": false + }, + "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", + "tags" + ], + "properties": { + "_links": { + "$ref": "#/definitions/links" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "commonEdgeRouterProperties": { + "type": "object", + "required": [ + "hostname", + "name", + "supportedProtocols", + "syncStatus", + "isOnline" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "hostname": { + "type": "string" + }, + "isOnline": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "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", + "error" + ], + "properties": { + "error": { + "$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" + } + } + }, + "updb": { + "type": "object", + "properties": { + "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" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "authenticators": { + "$ref": "#/definitions/identityAuthenticators" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "enrollment": { + "$ref": "#/definitions/identityEnrollments" + }, + "envInfo": { + "$ref": "#/definitions/envInfo" + }, + "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" + } + } + } + } + }, + "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" + } + } + }, + "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": { + "apiEnrolmentVersion": { + "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" + ] + }, + "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" + ], + "properties": { + "isPassing": { + "type": "boolean" + }, + "process": { + "$ref": "#/definitions/postureQueryProcess" + }, + "processes": { + "type": "array", + "items": { + "$ref": "#/definitions/postureQueryProcess" + } + }, + "queryType": { + "$ref": "#/definitions/postureCheckType" + }, + "timeout": { + "type": "integer" + } + } + } + ] + }, + "postureQueryProcess": { + "type": "object", + "properties": { + "osType": { + "$ref": "#/definitions/osType" + }, + "path": { + "type": "string" + } + } + }, + "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" + }, + "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" + }, + "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": { + "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": { + "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": { + "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" + ], + "properties": { + "apiSession": { + "$ref": "#/definitions/entityRef" + }, + "apiSessionId": { + "type": "string" + }, + "edgeRouters": { + "type": "array", + "items": { + "$ref": "#/definitions/sessionEdgeRouter" + } + }, + "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" + } + }, + "tags": { + "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "x-omitempty": false + }, + "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_server/operations/authentication/authenticate.go b/rest_client_api_server/operations/authentication/authenticate.go similarity index 96% rename from rest_server/operations/authentication/authenticate.go rename to rest_client_api_server/operations/authentication/authenticate.go index e73032579..7b38405a1 100644 --- a/rest_server/operations/authentication/authenticate.go +++ b/rest_client_api_server/operations/authentication/authenticate.go @@ -53,7 +53,7 @@ func NewAuthenticate(ctx *middleware.Context, handler AuthenticateHandler) *Auth return &Authenticate{Context: ctx, Handler: handler} } -/*Authenticate swagger:route POST /authenticate Authentication authenticate +/* Authenticate swagger:route POST /authenticate Authentication authenticate Authenticate via a method supplied via a query string parameter @@ -69,17 +69,15 @@ type Authenticate struct { func (o *Authenticate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/authentication/authenticate_mfa.go b/rest_client_api_server/operations/authentication/authenticate_mfa.go similarity index 93% rename from rest_server/operations/authentication/authenticate_mfa.go rename to rest_client_api_server/operations/authentication/authenticate_mfa.go index 7c6b19fb6..5e4daef70 100644 --- a/rest_server/operations/authentication/authenticate_mfa.go +++ b/rest_client_api_server/operations/authentication/authenticate_mfa.go @@ -53,7 +53,7 @@ func NewAuthenticateMfa(ctx *middleware.Context, handler AuthenticateMfaHandler) return &AuthenticateMfa{Context: ctx, Handler: handler} } -/*AuthenticateMfa swagger:route POST /authenticate/mfa Authentication MFA authenticateMfa +/* AuthenticateMfa swagger:route POST /authenticate/mfa Authentication MFA authenticateMfa Complete MFA authentication @@ -68,21 +68,20 @@ type AuthenticateMfa struct { func (o *AuthenticateMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *AuthenticateMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authentication/authenticate_mfa_parameters.go b/rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go similarity index 91% rename from rest_server/operations/authentication/authenticate_mfa_parameters.go rename to rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go index 238d4c6c9..f5e4af083 100644 --- a/rest_server/operations/authentication/authenticate_mfa_parameters.go +++ b/rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go @@ -30,18 +30,21 @@ package authentication // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewAuthenticateMfaParams() AuthenticateMfaParams { return AuthenticateMfaParams{} @@ -87,6 +90,11 @@ func (o *AuthenticateMfaParams) BindRequest(r *http.Request, route *middleware.M 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 } diff --git a/rest_server/operations/authentication/authenticate_mfa_responses.go b/rest_client_api_server/operations/authentication/authenticate_mfa_responses.go similarity index 100% rename from rest_server/operations/authentication/authenticate_mfa_responses.go rename to rest_client_api_server/operations/authentication/authenticate_mfa_responses.go diff --git a/rest_server/operations/authentication/authenticate_mfa_urlbuilder.go b/rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go similarity index 99% rename from rest_server/operations/authentication/authenticate_mfa_urlbuilder.go rename to rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go index cd1681034..c116c96a6 100644 --- a/rest_server/operations/authentication/authenticate_mfa_urlbuilder.go +++ b/rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go @@ -63,7 +63,7 @@ func (o *AuthenticateMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authentication/authenticate_parameters.go b/rest_client_api_server/operations/authentication/authenticate_parameters.go similarity index 94% rename from rest_server/operations/authentication/authenticate_parameters.go rename to rest_client_api_server/operations/authentication/authenticate_parameters.go index 84ad212c2..89e2ca121 100644 --- a/rest_server/operations/authentication/authenticate_parameters.go +++ b/rest_client_api_server/operations/authentication/authenticate_parameters.go @@ -30,6 +30,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "github.com/go-openapi/errors" @@ -42,7 +43,8 @@ import ( ) // NewAuthenticateParams creates a new AuthenticateParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewAuthenticateParams() AuthenticateParams { return AuthenticateParams{} @@ -90,16 +92,21 @@ func (o *AuthenticateParams) BindRequest(r *http.Request, route *middleware.Matc 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...) } @@ -118,10 +125,10 @@ func (o *AuthenticateParams) bindMethod(rawData []string, hasKey bool, formats s // 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 { diff --git a/rest_server/operations/authentication/authenticate_responses.go b/rest_client_api_server/operations/authentication/authenticate_responses.go similarity index 100% rename from rest_server/operations/authentication/authenticate_responses.go rename to rest_client_api_server/operations/authentication/authenticate_responses.go diff --git a/rest_server/operations/authentication/authenticate_urlbuilder.go b/rest_client_api_server/operations/authentication/authenticate_urlbuilder.go similarity index 99% rename from rest_server/operations/authentication/authenticate_urlbuilder.go rename to rest_client_api_server/operations/authentication/authenticate_urlbuilder.go index cc3c1b373..c6d0d6df6 100644 --- a/rest_server/operations/authentication/authenticate_urlbuilder.go +++ b/rest_client_api_server/operations/authentication/authenticate_urlbuilder.go @@ -67,7 +67,7 @@ func (o *AuthenticateURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/current_api_session/create_current_api_session_certificate.go rename to rest_client_api_server/operations/current_api_session/create_current_api_session_certificate.go index 78287d939..92d29a9c6 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewCreateCurrentAPISessionCertificate(ctx *middleware.Context, handler Crea return &CreateCurrentAPISessionCertificate{Context: ctx, Handler: handler} } -/*CreateCurrentAPISessionCertificate swagger:route POST /current-api-session/certificates Current API Session createCurrentApiSessionCertificate +/* CreateCurrentAPISessionCertificate swagger:route POST /current-api-session/certificates Current API Session createCurrentApiSessionCertificate Creates an ephemeral certificate for the current API Session @@ -68,21 +68,20 @@ type CreateCurrentAPISessionCertificate struct { func (o *CreateCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 92% rename from rest_server/operations/current_api_session/create_current_api_session_certificate_parameters.go rename to rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_parameters.go index 8be8a26b8..13c7eceeb 100644 --- a/rest_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 @@ -30,18 +30,21 @@ package current_api_session // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateCurrentAPISessionCertificateParams() CreateCurrentAPISessionCertificateParams { return CreateCurrentAPISessionCertificateParams{} @@ -87,6 +90,11 @@ func (o *CreateCurrentAPISessionCertificateParams) BindRequest(r *http.Request, 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 } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/create_current_api_session_certificate_responses.go rename to rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go index 25cd8d6db..9406da476 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *CreateCurrentAPISessionCertificateURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/delete_current_api_session.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session.go similarity index 93% rename from rest_server/operations/current_api_session/delete_current_api_session.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session.go index f61aa3dd7..e736f55a3 100644 --- a/rest_server/operations/current_api_session/delete_current_api_session.go +++ b/rest_client_api_server/operations/current_api_session/delete_current_api_session.go @@ -53,7 +53,7 @@ func NewDeleteCurrentAPISession(ctx *middleware.Context, handler DeleteCurrentAP return &DeleteCurrentAPISession{Context: ctx, Handler: handler} } -/*DeleteCurrentAPISession swagger:route DELETE /current-api-session Current API Session deleteCurrentApiSession +/* DeleteCurrentAPISession swagger:route DELETE /current-api-session Current API Session deleteCurrentApiSession Logout @@ -68,21 +68,20 @@ type DeleteCurrentAPISession struct { func (o *DeleteCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Requ } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 92% rename from rest_server/operations/current_api_session/delete_current_api_session_certificate.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate.go index 724b1670a..74d374836 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewDeleteCurrentAPISessionCertificate(ctx *middleware.Context, handler Dele return &DeleteCurrentAPISessionCertificate{Context: ctx, Handler: handler} } -/*DeleteCurrentAPISessionCertificate swagger:route DELETE /current-api-session/certificates/{id} Current API Session deleteCurrentApiSessionCertificate +/* DeleteCurrentAPISessionCertificate swagger:route DELETE /current-api-session/certificates/{id} Current API Session deleteCurrentApiSessionCertificate Delete an ephemeral certificate @@ -69,21 +69,20 @@ type DeleteCurrentAPISessionCertificate struct { func (o *DeleteCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *DeleteCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/current_api_session/delete_current_api_session_certificate_parameters.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_parameters.go index c1cf57cfd..a14cf99dc 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDeleteCurrentAPISessionCertificateParams creates a new DeleteCurrentAPISessionCertificateParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteCurrentAPISessionCertificateParams() DeleteCurrentAPISessionCertificateParams { return DeleteCurrentAPISessionCertificateParams{} @@ -73,7 +74,6 @@ func (o *DeleteCurrentAPISessionCertificateParams) BindRequest(r *http.Request, if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteCurrentAPISessionCertificateParams) bindID(rawData []string, hasK // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/delete_current_api_session_certificate_responses.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go index f9bc61beb..c04808c13 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DeleteCurrentAPISessionCertificateURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 97% rename from rest_server/operations/current_api_session/delete_current_api_session_parameters.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_parameters.go index 2c7b68d45..d22bb81c4 100644 --- a/rest_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 @@ -37,7 +37,8 @@ import ( ) // NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteCurrentAPISessionParams() DeleteCurrentAPISessionParams { return DeleteCurrentAPISessionParams{} diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/delete_current_api_session_responses.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/delete_current_api_session_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go index 6df03537e..501488e73 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *DeleteCurrentAPISessionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/current_api_session/detail_current_api_session_certificate.go rename to rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate.go index 3cd1b5b86..cd7200b85 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewDetailCurrentAPISessionCertificate(ctx *middleware.Context, handler Deta return &DetailCurrentAPISessionCertificate{Context: ctx, Handler: handler} } -/*DetailCurrentAPISessionCertificate swagger:route GET /current-api-session/certificates/{id} Current API Session detailCurrentApiSessionCertificate +/* DetailCurrentAPISessionCertificate swagger:route GET /current-api-session/certificates/{id} Current API Session detailCurrentApiSessionCertificate Retrieves an ephemeral certificate @@ -68,21 +68,20 @@ type DetailCurrentAPISessionCertificate struct { func (o *DetailCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/current_api_session/detail_current_api_session_certificate_parameters.go rename to rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_parameters.go index 46bb92597..a829b6add 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDetailCurrentAPISessionCertificateParams creates a new DetailCurrentAPISessionCertificateParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailCurrentAPISessionCertificateParams() DetailCurrentAPISessionCertificateParams { return DetailCurrentAPISessionCertificateParams{} @@ -73,7 +74,6 @@ func (o *DetailCurrentAPISessionCertificateParams) BindRequest(r *http.Request, if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailCurrentAPISessionCertificateParams) bindID(rawData []string, hasK // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/detail_current_api_session_certificate_responses.go rename to rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go index 622805586..967581065 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DetailCurrentAPISessionCertificateURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/detail_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go similarity index 93% rename from rest_server/operations/current_api_session/detail_current_identity_authenticator.go rename to rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go index 04cd58d25..d0fe329ad 100644 --- a/rest_server/operations/current_api_session/detail_current_identity_authenticator.go +++ b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go @@ -53,7 +53,7 @@ func NewDetailCurrentIdentityAuthenticator(ctx *middleware.Context, handler Deta return &DetailCurrentIdentityAuthenticator{Context: ctx, Handler: handler} } -/*DetailCurrentIdentityAuthenticator swagger:route GET /current-identity/authenticators/{id} Current API Session detailCurrentIdentityAuthenticator +/* DetailCurrentIdentityAuthenticator swagger:route GET /current-identity/authenticators/{id} Current API Session detailCurrentIdentityAuthenticator Retrieve an authenticator for the current identity @@ -68,21 +68,20 @@ type DetailCurrentIdentityAuthenticator struct { func (o *DetailCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go rename to rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go index 9da568cc2..a806f952d 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailCurrentIdentityAuthenticatorParams() DetailCurrentIdentityAuthenticatorParams { return DetailCurrentIdentityAuthenticatorParams{} @@ -73,7 +74,6 @@ func (o *DetailCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasK // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/detail_current_identity_authenticator_responses.go rename to rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go index 40be3af2e..eabffbf46 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DetailCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/get_current_api_session.go b/rest_client_api_server/operations/current_api_session/get_current_api_session.go similarity index 93% rename from rest_server/operations/current_api_session/get_current_api_session.go rename to rest_client_api_server/operations/current_api_session/get_current_api_session.go index dcf735255..7bcd9a715 100644 --- a/rest_server/operations/current_api_session/get_current_api_session.go +++ b/rest_client_api_server/operations/current_api_session/get_current_api_session.go @@ -53,7 +53,7 @@ func NewGetCurrentAPISession(ctx *middleware.Context, handler GetCurrentAPISessi return &GetCurrentAPISession{Context: ctx, Handler: handler} } -/*GetCurrentAPISession swagger:route GET /current-api-session Current API Session getCurrentApiSession +/* GetCurrentAPISession swagger:route GET /current-api-session Current API Session getCurrentApiSession Return the current API session @@ -68,21 +68,20 @@ type GetCurrentAPISession struct { func (o *GetCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *GetCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 97% rename from rest_server/operations/current_api_session/get_current_api_session_parameters.go rename to rest_client_api_server/operations/current_api_session/get_current_api_session_parameters.go index 1ff8fe6cf..a4d6b8e02 100644 --- a/rest_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 @@ -37,7 +37,8 @@ import ( ) // NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetCurrentAPISessionParams() GetCurrentAPISessionParams { return GetCurrentAPISessionParams{} diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/get_current_api_session_responses.go rename to rest_client_api_server/operations/current_api_session/get_current_api_session_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/get_current_api_session_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go index 793f20737..ce47c9f5d 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *GetCurrentAPISessionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/current_api_session/list_current_api_session_certificates.go rename to rest_client_api_server/operations/current_api_session/list_current_api_session_certificates.go index 080134ed8..eb23a452b 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListCurrentAPISessionCertificates(ctx *middleware.Context, handler ListC return &ListCurrentAPISessionCertificates{Context: ctx, Handler: handler} } -/*ListCurrentAPISessionCertificates swagger:route GET /current-api-session/certificates Current API Session listCurrentApiSessionCertificates +/* ListCurrentAPISessionCertificates swagger:route GET /current-api-session/certificates Current API Session listCurrentApiSessionCertificates List the ephemeral certificates available for the current API Session @@ -68,21 +68,20 @@ type ListCurrentAPISessionCertificates struct { func (o *ListCurrentAPISessionCertificates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListCurrentAPISessionCertificates) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/current_api_session/list_current_api_session_certificates_parameters.go rename to rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_parameters.go index e2f61da97..8de8ef6ae 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListCurrentAPISessionCertificatesParams creates a new ListCurrentAPISessionCertificatesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListCurrentAPISessionCertificatesParams() ListCurrentAPISessionCertificatesParams { return ListCurrentAPISessionCertificatesParams{} @@ -94,7 +95,6 @@ func (o *ListCurrentAPISessionCertificatesParams) BindRequest(r *http.Request, r if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListCurrentAPISessionCertificatesParams) bindFilter(rawData []string, h // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListCurrentAPISessionCertificatesParams) bindLimit(rawData []string, ha // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListCurrentAPISessionCertificatesParams) bindOffset(rawData []string, h // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/list_current_api_session_certificates_responses.go rename to rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go index 165d2238c..07b505ea9 100644 --- a/rest_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 @@ -71,7 +71,7 @@ func (o *ListCurrentAPISessionCertificatesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/list_current_identity_authenticators.go b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go similarity index 93% rename from rest_server/operations/current_api_session/list_current_identity_authenticators.go rename to rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go index 157fca1c0..863e8fe47 100644 --- a/rest_server/operations/current_api_session/list_current_identity_authenticators.go +++ b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go @@ -53,7 +53,7 @@ func NewListCurrentIdentityAuthenticators(ctx *middleware.Context, handler ListC return &ListCurrentIdentityAuthenticators{Context: ctx, Handler: handler} } -/*ListCurrentIdentityAuthenticators swagger:route GET /current-identity/authenticators Current API Session listCurrentIdentityAuthenticators +/* ListCurrentIdentityAuthenticators swagger:route GET /current-identity/authenticators Current API Session listCurrentIdentityAuthenticators List authenticators for the current identity @@ -68,21 +68,20 @@ type ListCurrentIdentityAuthenticators struct { func (o *ListCurrentIdentityAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListCurrentIdentityAuthenticators) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/current_api_session/list_current_identity_authenticators_parameters.go rename to rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go index 03ad202d2..41ece3d8f 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListCurrentIdentityAuthenticatorsParams() ListCurrentIdentityAuthenticatorsParams { return ListCurrentIdentityAuthenticatorsParams{} @@ -94,7 +95,6 @@ func (o *ListCurrentIdentityAuthenticatorsParams) BindRequest(r *http.Request, r if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListCurrentIdentityAuthenticatorsParams) bindFilter(rawData []string, h // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListCurrentIdentityAuthenticatorsParams) bindLimit(rawData []string, ha // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListCurrentIdentityAuthenticatorsParams) bindOffset(rawData []string, h // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/list_current_identity_authenticators_responses.go rename to rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go index d80482e7f..8ddffa31d 100644 --- a/rest_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 @@ -71,7 +71,7 @@ func (o *ListCurrentIdentityAuthenticatorsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/list_service_updates.go b/rest_client_api_server/operations/current_api_session/list_service_updates.go similarity index 93% rename from rest_server/operations/current_api_session/list_service_updates.go rename to rest_client_api_server/operations/current_api_session/list_service_updates.go index 9017f8402..dbc9004ee 100644 --- a/rest_server/operations/current_api_session/list_service_updates.go +++ b/rest_client_api_server/operations/current_api_session/list_service_updates.go @@ -53,7 +53,7 @@ func NewListServiceUpdates(ctx *middleware.Context, handler ListServiceUpdatesHa return &ListServiceUpdates{Context: ctx, Handler: handler} } -/*ListServiceUpdates swagger:route GET /current-api-session/service-updates Current API Session Services listServiceUpdates +/* 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 @@ -70,21 +70,20 @@ type ListServiceUpdates struct { func (o *ListServiceUpdates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *ListServiceUpdates) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_api_session/list_service_updates_parameters.go b/rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go similarity index 97% rename from rest_server/operations/current_api_session/list_service_updates_parameters.go rename to rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go index 0d8b977d1..36c8395a9 100644 --- a/rest_server/operations/current_api_session/list_service_updates_parameters.go +++ b/rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListServiceUpdatesParams creates a new ListServiceUpdatesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceUpdatesParams() ListServiceUpdatesParams { return ListServiceUpdatesParams{} diff --git a/rest_server/operations/current_api_session/list_service_updates_responses.go b/rest_client_api_server/operations/current_api_session/list_service_updates_responses.go similarity index 100% rename from rest_server/operations/current_api_session/list_service_updates_responses.go rename to rest_client_api_server/operations/current_api_session/list_service_updates_responses.go diff --git a/rest_server/operations/current_api_session/list_service_updates_urlbuilder.go b/rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go similarity index 99% rename from rest_server/operations/current_api_session/list_service_updates_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go index 74d288118..a5d70d21b 100644 --- a/rest_server/operations/current_api_session/list_service_updates_urlbuilder.go +++ b/rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListServiceUpdatesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/patch_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go similarity index 93% rename from rest_server/operations/current_api_session/patch_current_identity_authenticator.go rename to rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go index 3209bc8de..789f47662 100644 --- a/rest_server/operations/current_api_session/patch_current_identity_authenticator.go +++ b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go @@ -53,7 +53,7 @@ func NewPatchCurrentIdentityAuthenticator(ctx *middleware.Context, handler Patch return &PatchCurrentIdentityAuthenticator{Context: ctx, Handler: handler} } -/*PatchCurrentIdentityAuthenticator swagger:route PATCH /current-identity/authenticators/{id} Current API Session patchCurrentIdentityAuthenticator +/* PatchCurrentIdentityAuthenticator swagger:route PATCH /current-identity/authenticators/{id} Current API Session patchCurrentIdentityAuthenticator Update the supplied fields on an authenticator of this identity @@ -70,21 +70,20 @@ type PatchCurrentIdentityAuthenticator struct { func (o *PatchCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *PatchCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go rename to rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go index 6608aa702..d2cb910c4 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package current_api_session // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchCurrentIdentityAuthenticatorParams() PatchCurrentIdentityAuthenticatorParams { return PatchCurrentIdentityAuthenticatorParams{} @@ -93,6 +96,11 @@ func (o *PatchCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, r 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 } @@ -100,11 +108,11 @@ func (o *PatchCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, r } 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...) } @@ -120,7 +128,6 @@ func (o *PatchCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKe // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/patch_current_identity_authenticator_responses.go rename to rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go index 01a22b141..24e7d8a3d 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *PatchCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_api_session/update_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go similarity index 93% rename from rest_server/operations/current_api_session/update_current_identity_authenticator.go rename to rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go index b36d83a7e..669113fd8 100644 --- a/rest_server/operations/current_api_session/update_current_identity_authenticator.go +++ b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go @@ -53,7 +53,7 @@ func NewUpdateCurrentIdentityAuthenticator(ctx *middleware.Context, handler Upda return &UpdateCurrentIdentityAuthenticator{Context: ctx, Handler: handler} } -/*UpdateCurrentIdentityAuthenticator swagger:route PUT /current-identity/authenticators/{id} Current API Session updateCurrentIdentityAuthenticator +/* UpdateCurrentIdentityAuthenticator swagger:route PUT /current-identity/authenticators/{id} Current API Session updateCurrentIdentityAuthenticator Update all fields on an authenticator of this identity @@ -70,21 +70,20 @@ type UpdateCurrentIdentityAuthenticator struct { func (o *UpdateCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *UpdateCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/current_api_session/update_current_identity_authenticator_parameters.go rename to rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go index 739eb70d6..6807bd672 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package current_api_session // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateCurrentIdentityAuthenticatorParams() UpdateCurrentIdentityAuthenticatorParams { return UpdateCurrentIdentityAuthenticatorParams{} @@ -93,6 +96,11 @@ func (o *UpdateCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, 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 } @@ -100,11 +108,11 @@ func (o *UpdateCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasK // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_api_session/update_current_identity_authenticator_responses.go rename to rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go rename to rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go index 979804749..bfa66ec85 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *UpdateCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/create_mfa_recovery_codes.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go similarity index 93% rename from rest_server/operations/current_identity/create_mfa_recovery_codes.go rename to rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go index 81d4b264a..99d5a29e4 100644 --- a/rest_server/operations/current_identity/create_mfa_recovery_codes.go +++ b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go @@ -53,7 +53,7 @@ func NewCreateMfaRecoveryCodes(ctx *middleware.Context, handler CreateMfaRecover return &CreateMfaRecoveryCodes{Context: ctx, Handler: handler} } -/*CreateMfaRecoveryCodes swagger:route POST /current-identity/mfa/recovery-codes Current Identity MFA createMfaRecoveryCodes +/* CreateMfaRecoveryCodes swagger:route POST /current-identity/mfa/recovery-codes Current Identity MFA createMfaRecoveryCodes For a completed MFA enrollment regenerate the recovery codes @@ -69,21 +69,20 @@ type CreateMfaRecoveryCodes struct { func (o *CreateMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *CreateMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/create_mfa_recovery_codes_parameters.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go similarity index 92% rename from rest_server/operations/current_identity/create_mfa_recovery_codes_parameters.go rename to rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go index b3c155a35..b114b26d8 100644 --- a/rest_server/operations/current_identity/create_mfa_recovery_codes_parameters.go +++ b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go @@ -30,18 +30,21 @@ package current_identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateMfaRecoveryCodesParams() CreateMfaRecoveryCodesParams { return CreateMfaRecoveryCodesParams{} @@ -87,6 +90,11 @@ func (o *CreateMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middl 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 } diff --git a/rest_server/operations/current_identity/create_mfa_recovery_codes_responses.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go similarity index 100% rename from rest_server/operations/current_identity/create_mfa_recovery_codes_responses.go rename to rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go diff --git a/rest_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go rename to rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go index cff06128a..c2784c689 100644 --- a/rest_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateMfaRecoveryCodesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/delete_mfa.go b/rest_client_api_server/operations/current_identity/delete_mfa.go similarity index 94% rename from rest_server/operations/current_identity/delete_mfa.go rename to rest_client_api_server/operations/current_identity/delete_mfa.go index eb05f273f..3f0a5b32b 100644 --- a/rest_server/operations/current_identity/delete_mfa.go +++ b/rest_client_api_server/operations/current_identity/delete_mfa.go @@ -53,7 +53,7 @@ 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 +/* DeleteMfa swagger:route DELETE /current-identity/mfa Current Identity MFA deleteMfa Disable MFA for the current identity @@ -69,21 +69,20 @@ type DeleteMfa struct { func (o *DeleteMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *DeleteMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/delete_mfa_parameters.go b/rest_client_api_server/operations/current_identity/delete_mfa_parameters.go similarity index 92% rename from rest_server/operations/current_identity/delete_mfa_parameters.go rename to rest_client_api_server/operations/current_identity/delete_mfa_parameters.go index 534e4a8ec..8d96e2976 100644 --- a/rest_server/operations/current_identity/delete_mfa_parameters.go +++ b/rest_client_api_server/operations/current_identity/delete_mfa_parameters.go @@ -30,18 +30,21 @@ package current_identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteMfaParams() DeleteMfaParams { return DeleteMfaParams{} @@ -90,6 +93,11 @@ func (o *DeleteMfaParams) BindRequest(r *http.Request, route *middleware.Matched 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 } @@ -113,7 +121,6 @@ func (o *DeleteMfaParams) bindMfaValidationCode(rawData []string, hasKey bool, f if raw == "" { // empty values pass all other validations return nil } - o.MfaValidationCode = &raw return nil diff --git a/rest_server/operations/current_identity/delete_mfa_responses.go b/rest_client_api_server/operations/current_identity/delete_mfa_responses.go similarity index 100% rename from rest_server/operations/current_identity/delete_mfa_responses.go rename to rest_client_api_server/operations/current_identity/delete_mfa_responses.go diff --git a/rest_server/operations/current_identity/delete_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/delete_mfa_urlbuilder.go rename to rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go index b9d75c0d0..627405d95 100644 --- a/rest_server/operations/current_identity/delete_mfa_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go @@ -63,7 +63,7 @@ func (o *DeleteMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/detail_mfa.go b/rest_client_api_server/operations/current_identity/detail_mfa.go similarity index 94% rename from rest_server/operations/current_identity/detail_mfa.go rename to rest_client_api_server/operations/current_identity/detail_mfa.go index e81a1d82e..4f5525646 100644 --- a/rest_server/operations/current_identity/detail_mfa.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa.go @@ -53,7 +53,7 @@ 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 +/* DetailMfa swagger:route GET /current-identity/mfa Current Identity MFA detailMfa Returns the current status of MFA enrollment @@ -69,21 +69,20 @@ type DetailMfa struct { func (o *DetailMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *DetailMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/detail_mfa_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_parameters.go similarity index 97% rename from rest_server/operations/current_identity/detail_mfa_parameters.go rename to rest_client_api_server/operations/current_identity/detail_mfa_parameters.go index 5387d55b7..7339b9edc 100644 --- a/rest_server/operations/current_identity/detail_mfa_parameters.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewDetailMfaParams creates a new DetailMfaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailMfaParams() DetailMfaParams { return DetailMfaParams{} diff --git a/rest_server/operations/current_identity/detail_mfa_qr_code.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go similarity index 93% rename from rest_server/operations/current_identity/detail_mfa_qr_code.go rename to rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go index 5f7c32889..dc9596756 100644 --- a/rest_server/operations/current_identity/detail_mfa_qr_code.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go @@ -53,7 +53,7 @@ func NewDetailMfaQrCode(ctx *middleware.Context, handler DetailMfaQrCodeHandler) return &DetailMfaQrCode{Context: ctx, Handler: handler} } -/*DetailMfaQrCode swagger:route GET /current-identity/mfa/qr-code Current Identity MFA detailMfaQrCode +/* DetailMfaQrCode swagger:route GET /current-identity/mfa/qr-code Current Identity MFA detailMfaQrCode Show a QR code for unverified MFA enrollments @@ -69,21 +69,20 @@ type DetailMfaQrCode struct { func (o *DetailMfaQrCode) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *DetailMfaQrCode) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/detail_mfa_qr_code_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go similarity index 97% rename from rest_server/operations/current_identity/detail_mfa_qr_code_parameters.go rename to rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go index 718620041..cb3f9b987 100644 --- a/rest_server/operations/current_identity/detail_mfa_qr_code_parameters.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailMfaQrCodeParams() DetailMfaQrCodeParams { return DetailMfaQrCodeParams{} diff --git a/rest_server/operations/current_identity/detail_mfa_qr_code_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_responses.go similarity index 100% rename from rest_server/operations/current_identity/detail_mfa_qr_code_responses.go rename to rest_client_api_server/operations/current_identity/detail_mfa_qr_code_responses.go diff --git a/rest_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go rename to rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go index 393c1b567..1801a91e5 100644 --- a/rest_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go @@ -63,7 +63,7 @@ func (o *DetailMfaQrCodeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/detail_mfa_recovery_codes.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go similarity index 93% rename from rest_server/operations/current_identity/detail_mfa_recovery_codes.go rename to rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go index 2f755013b..d4d6cab65 100644 --- a/rest_server/operations/current_identity/detail_mfa_recovery_codes.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go @@ -53,7 +53,7 @@ func NewDetailMfaRecoveryCodes(ctx *middleware.Context, handler DetailMfaRecover return &DetailMfaRecoveryCodes{Context: ctx, Handler: handler} } -/*DetailMfaRecoveryCodes swagger:route GET /current-identity/mfa/recovery-codes Current Identity MFA detailMfaRecoveryCodes +/* DetailMfaRecoveryCodes swagger:route GET /current-identity/mfa/recovery-codes Current Identity MFA detailMfaRecoveryCodes For a completed MFA enrollment view the current recovery codes @@ -69,21 +69,20 @@ type DetailMfaRecoveryCodes struct { func (o *DetailMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *DetailMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go similarity index 93% rename from rest_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go rename to rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go index da774e687..c5a42cfb8 100644 --- a/rest_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go @@ -30,18 +30,21 @@ package current_identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailMfaRecoveryCodesParams() DetailMfaRecoveryCodesParams { return DetailMfaRecoveryCodesParams{} @@ -90,6 +93,11 @@ func (o *DetailMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middl 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 } @@ -113,7 +121,6 @@ func (o *DetailMfaRecoveryCodesParams) bindMfaValidationCode(rawData []string, h if raw == "" { // empty values pass all other validations return nil } - o.MfaValidationCode = &raw return nil diff --git a/rest_server/operations/current_identity/detail_mfa_recovery_codes_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go similarity index 100% rename from rest_server/operations/current_identity/detail_mfa_recovery_codes_responses.go rename to rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go diff --git a/rest_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go rename to rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go index 50afeb7a1..51f1afb48 100644 --- a/rest_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go @@ -63,7 +63,7 @@ func (o *DetailMfaRecoveryCodesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/detail_mfa_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_responses.go similarity index 100% rename from rest_server/operations/current_identity/detail_mfa_responses.go rename to rest_client_api_server/operations/current_identity/detail_mfa_responses.go diff --git a/rest_server/operations/current_identity/detail_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/detail_mfa_urlbuilder.go rename to rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go index 76a6b6181..3790c1450 100644 --- a/rest_server/operations/current_identity/detail_mfa_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go @@ -63,7 +63,7 @@ func (o *DetailMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/enroll_mfa.go b/rest_client_api_server/operations/current_identity/enroll_mfa.go similarity index 94% rename from rest_server/operations/current_identity/enroll_mfa.go rename to rest_client_api_server/operations/current_identity/enroll_mfa.go index b425fcb4d..79b30e0b9 100644 --- a/rest_server/operations/current_identity/enroll_mfa.go +++ b/rest_client_api_server/operations/current_identity/enroll_mfa.go @@ -53,7 +53,7 @@ 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 +/* EnrollMfa swagger:route POST /current-identity/mfa Current Identity MFA enrollMfa Initiate MFA enrollment @@ -69,21 +69,20 @@ type EnrollMfa struct { func (o *EnrollMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *EnrollMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/enroll_mfa_parameters.go b/rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go similarity index 97% rename from rest_server/operations/current_identity/enroll_mfa_parameters.go rename to rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go index 0cf577735..0ac0f7152 100644 --- a/rest_server/operations/current_identity/enroll_mfa_parameters.go +++ b/rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewEnrollMfaParams creates a new EnrollMfaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollMfaParams() EnrollMfaParams { return EnrollMfaParams{} diff --git a/rest_server/operations/current_identity/enroll_mfa_responses.go b/rest_client_api_server/operations/current_identity/enroll_mfa_responses.go similarity index 100% rename from rest_server/operations/current_identity/enroll_mfa_responses.go rename to rest_client_api_server/operations/current_identity/enroll_mfa_responses.go diff --git a/rest_server/operations/current_identity/enroll_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/enroll_mfa_urlbuilder.go rename to rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go index 460922708..4f391df20 100644 --- a/rest_server/operations/current_identity/enroll_mfa_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go @@ -63,7 +63,7 @@ func (o *EnrollMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/get_current_identity.go b/rest_client_api_server/operations/current_identity/get_current_identity.go similarity index 93% rename from rest_server/operations/current_identity/get_current_identity.go rename to rest_client_api_server/operations/current_identity/get_current_identity.go index ec7c476af..6244e7444 100644 --- a/rest_server/operations/current_identity/get_current_identity.go +++ b/rest_client_api_server/operations/current_identity/get_current_identity.go @@ -53,7 +53,7 @@ func NewGetCurrentIdentity(ctx *middleware.Context, handler GetCurrentIdentityHa return &GetCurrentIdentity{Context: ctx, Handler: handler} } -/*GetCurrentIdentity swagger:route GET /current-identity Current Identity getCurrentIdentity +/* GetCurrentIdentity swagger:route GET /current-identity Current Identity getCurrentIdentity Return the current identity @@ -68,21 +68,20 @@ type GetCurrentIdentity struct { func (o *GetCurrentIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *GetCurrentIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/get_current_identity_edge_routers.go b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go similarity index 93% rename from rest_server/operations/current_identity/get_current_identity_edge_routers.go rename to rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go index 78db9a550..88e00bfee 100644 --- a/rest_server/operations/current_identity/get_current_identity_edge_routers.go +++ b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go @@ -53,7 +53,7 @@ func NewGetCurrentIdentityEdgeRouters(ctx *middleware.Context, handler GetCurren return &GetCurrentIdentityEdgeRouters{Context: ctx, Handler: handler} } -/*GetCurrentIdentityEdgeRouters swagger:route GET /current-identity/edge-routers Current Identity Edge Router getCurrentIdentityEdgeRouters +/* GetCurrentIdentityEdgeRouters swagger:route GET /current-identity/edge-routers Current Identity Edge Router getCurrentIdentityEdgeRouters Return this list of Edge Routers the identity has access to @@ -70,21 +70,20 @@ type GetCurrentIdentityEdgeRouters struct { func (o *GetCurrentIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *GetCurrentIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 97% rename from rest_server/operations/current_identity/get_current_identity_edge_routers_parameters.go rename to rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_parameters.go index c3a934142..b2974e95d 100644 --- a/rest_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 @@ -37,7 +37,8 @@ import ( ) // NewGetCurrentIdentityEdgeRoutersParams creates a new GetCurrentIdentityEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetCurrentIdentityEdgeRoutersParams() GetCurrentIdentityEdgeRoutersParams { return GetCurrentIdentityEdgeRoutersParams{} diff --git a/rest_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 similarity index 100% rename from rest_server/operations/current_identity/get_current_identity_edge_routers_responses.go rename to rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go rename to rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go index e65ce881f..021901a64 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *GetCurrentIdentityEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/get_current_identity_parameters.go b/rest_client_api_server/operations/current_identity/get_current_identity_parameters.go similarity index 97% rename from rest_server/operations/current_identity/get_current_identity_parameters.go rename to rest_client_api_server/operations/current_identity/get_current_identity_parameters.go index d2d071d9a..bdcadc313 100644 --- a/rest_server/operations/current_identity/get_current_identity_parameters.go +++ b/rest_client_api_server/operations/current_identity/get_current_identity_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetCurrentIdentityParams() GetCurrentIdentityParams { return GetCurrentIdentityParams{} diff --git a/rest_server/operations/current_identity/get_current_identity_responses.go b/rest_client_api_server/operations/current_identity/get_current_identity_responses.go similarity index 100% rename from rest_server/operations/current_identity/get_current_identity_responses.go rename to rest_client_api_server/operations/current_identity/get_current_identity_responses.go diff --git a/rest_server/operations/current_identity/get_current_identity_urlbuilder.go b/rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/get_current_identity_urlbuilder.go rename to rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go index a0a4cd393..86099f334 100644 --- a/rest_server/operations/current_identity/get_current_identity_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go @@ -63,7 +63,7 @@ func (o *GetCurrentIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/current_identity/verify_mfa.go b/rest_client_api_server/operations/current_identity/verify_mfa.go similarity index 93% rename from rest_server/operations/current_identity/verify_mfa.go rename to rest_client_api_server/operations/current_identity/verify_mfa.go index 9fcfec4fc..d1917534f 100644 --- a/rest_server/operations/current_identity/verify_mfa.go +++ b/rest_client_api_server/operations/current_identity/verify_mfa.go @@ -53,7 +53,7 @@ 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 +/* VerifyMfa swagger:route POST /current-identity/mfa/verify Current Identity MFA verifyMfa Complete MFA enrollment by verifying a time based one time token @@ -69,21 +69,20 @@ type VerifyMfa struct { func (o *VerifyMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *VerifyMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/current_identity/verify_mfa_parameters.go b/rest_client_api_server/operations/current_identity/verify_mfa_parameters.go similarity index 91% rename from rest_server/operations/current_identity/verify_mfa_parameters.go rename to rest_client_api_server/operations/current_identity/verify_mfa_parameters.go index 4e8531fd3..e33b4307f 100644 --- a/rest_server/operations/current_identity/verify_mfa_parameters.go +++ b/rest_client_api_server/operations/current_identity/verify_mfa_parameters.go @@ -30,18 +30,21 @@ package current_identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewVerifyMfaParams() VerifyMfaParams { return VerifyMfaParams{} @@ -87,6 +90,11 @@ func (o *VerifyMfaParams) BindRequest(r *http.Request, route *middleware.Matched 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 } diff --git a/rest_server/operations/current_identity/verify_mfa_responses.go b/rest_client_api_server/operations/current_identity/verify_mfa_responses.go similarity index 100% rename from rest_server/operations/current_identity/verify_mfa_responses.go rename to rest_client_api_server/operations/current_identity/verify_mfa_responses.go diff --git a/rest_server/operations/current_identity/verify_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go similarity index 99% rename from rest_server/operations/current_identity/verify_mfa_urlbuilder.go rename to rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go index acd1a0e66..ebe510812 100644 --- a/rest_server/operations/current_identity/verify_mfa_urlbuilder.go +++ b/rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go @@ -63,7 +63,7 @@ func (o *VerifyMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/enroll.go b/rest_client_api_server/operations/enroll/enroll.go similarity index 97% rename from rest_server/operations/enroll/enroll.go rename to rest_client_api_server/operations/enroll/enroll.go index 6c5ef38c2..d9838d19a 100644 --- a/rest_server/operations/enroll/enroll.go +++ b/rest_client_api_server/operations/enroll/enroll.go @@ -53,7 +53,7 @@ func NewEnroll(ctx *middleware.Context, handler EnrollHandler) *Enroll { return &Enroll{Context: ctx, Handler: handler} } -/*Enroll swagger:route POST /enroll Enroll enroll +/* Enroll swagger:route POST /enroll Enroll enroll Legacy enrollment endpoint @@ -68,17 +68,15 @@ type Enroll struct { func (o *Enroll) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/enroll_ca.go b/rest_client_api_server/operations/enroll/enroll_ca.go similarity index 97% rename from rest_server/operations/enroll/enroll_ca.go rename to rest_client_api_server/operations/enroll/enroll_ca.go index ed0882468..e035f9473 100644 --- a/rest_server/operations/enroll/enroll_ca.go +++ b/rest_client_api_server/operations/enroll/enroll_ca.go @@ -53,7 +53,7 @@ func NewEnrollCa(ctx *middleware.Context, handler EnrollCaHandler) *EnrollCa { return &EnrollCa{Context: ctx, Handler: handler} } -/*EnrollCa swagger:route POST /enroll/ca Enroll enrollCa +/* EnrollCa swagger:route POST /enroll/ca Enroll enrollCa Enroll an identity with a pre-exchanged certificate @@ -73,17 +73,15 @@ type EnrollCa struct { func (o *EnrollCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/enroll_ca_parameters.go b/rest_client_api_server/operations/enroll/enroll_ca_parameters.go similarity index 97% rename from rest_server/operations/enroll/enroll_ca_parameters.go rename to rest_client_api_server/operations/enroll/enroll_ca_parameters.go index 8d293f020..c9a7a7fcb 100644 --- a/rest_server/operations/enroll/enroll_ca_parameters.go +++ b/rest_client_api_server/operations/enroll/enroll_ca_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewEnrollCaParams creates a new EnrollCaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollCaParams() EnrollCaParams { return EnrollCaParams{} diff --git a/rest_server/operations/enroll/enroll_ca_responses.go b/rest_client_api_server/operations/enroll/enroll_ca_responses.go similarity index 100% rename from rest_server/operations/enroll/enroll_ca_responses.go rename to rest_client_api_server/operations/enroll/enroll_ca_responses.go diff --git a/rest_server/operations/enroll/enroll_ca_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/enroll_ca_urlbuilder.go rename to rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go index 47ab5047a..b0cabfaa2 100644 --- a/rest_server/operations/enroll/enroll_ca_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go @@ -63,7 +63,7 @@ func (o *EnrollCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/enroll_er_ott.go b/rest_client_api_server/operations/enroll/enroll_er_ott.go similarity index 97% rename from rest_server/operations/enroll/enroll_er_ott.go rename to rest_client_api_server/operations/enroll/enroll_er_ott.go index 17224b6f9..c15395e27 100644 --- a/rest_server/operations/enroll/enroll_er_ott.go +++ b/rest_client_api_server/operations/enroll/enroll_er_ott.go @@ -53,7 +53,7 @@ func NewEnrollErOtt(ctx *middleware.Context, handler EnrollErOttHandler) *Enroll return &EnrollErOtt{Context: ctx, Handler: handler} } -/*EnrollErOtt swagger:route POST /enroll/erott Enroll enrollErOtt +/* EnrollErOtt swagger:route POST /enroll/erott Enroll enrollErOtt Enroll an edge-router @@ -69,17 +69,15 @@ type EnrollErOtt struct { func (o *EnrollErOtt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/enroll_er_ott_parameters.go b/rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go similarity index 98% rename from rest_server/operations/enroll/enroll_er_ott_parameters.go rename to rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go index 1ddcea71e..d999cbda5 100644 --- a/rest_server/operations/enroll/enroll_er_ott_parameters.go +++ b/rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewEnrollErOttParams creates a new EnrollErOttParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollErOttParams() EnrollErOttParams { return EnrollErOttParams{} @@ -77,7 +78,6 @@ func (o *EnrollErOttParams) BindRequest(r *http.Request, route *middleware.Match if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -96,6 +96,7 @@ func (o *EnrollErOttParams) bindToken(rawData []string, hasKey bool, formats str // Required: true // AllowEmptyValue: false + if err := validate.RequiredString("token", "query", raw); err != nil { return err } diff --git a/rest_server/operations/enroll/enroll_er_ott_responses.go b/rest_client_api_server/operations/enroll/enroll_er_ott_responses.go similarity index 100% rename from rest_server/operations/enroll/enroll_er_ott_responses.go rename to rest_client_api_server/operations/enroll/enroll_er_ott_responses.go diff --git a/rest_server/operations/enroll/enroll_er_ott_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/enroll_er_ott_urlbuilder.go rename to rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go index 1d858ea49..fe13e85c7 100644 --- a/rest_server/operations/enroll/enroll_er_ott_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go @@ -69,7 +69,7 @@ func (o *EnrollErOttURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/enroll_ott.go b/rest_client_api_server/operations/enroll/enroll_ott.go similarity index 97% rename from rest_server/operations/enroll/enroll_ott.go rename to rest_client_api_server/operations/enroll/enroll_ott.go index 918411a1f..bf64dc5d2 100644 --- a/rest_server/operations/enroll/enroll_ott.go +++ b/rest_client_api_server/operations/enroll/enroll_ott.go @@ -53,7 +53,7 @@ func NewEnrollOtt(ctx *middleware.Context, handler EnrollOttHandler) *EnrollOtt return &EnrollOtt{Context: ctx, Handler: handler} } -/*EnrollOtt swagger:route POST /enroll/ott Enroll enrollOtt +/* EnrollOtt swagger:route POST /enroll/ott Enroll enrollOtt Enroll an identity via one-time-token @@ -71,17 +71,15 @@ type EnrollOtt struct { func (o *EnrollOtt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/enroll_ott_ca.go b/rest_client_api_server/operations/enroll/enroll_ott_ca.go similarity index 97% rename from rest_server/operations/enroll/enroll_ott_ca.go rename to rest_client_api_server/operations/enroll/enroll_ott_ca.go index 155f7551e..c2962db7c 100644 --- a/rest_server/operations/enroll/enroll_ott_ca.go +++ b/rest_client_api_server/operations/enroll/enroll_ott_ca.go @@ -53,7 +53,7 @@ func NewEnrollOttCa(ctx *middleware.Context, handler EnrollOttCaHandler) *Enroll return &EnrollOttCa{Context: ctx, Handler: handler} } -/*EnrollOttCa swagger:route POST /enroll/ottca Enroll enrollOttCa +/* EnrollOttCa swagger:route POST /enroll/ottca Enroll enrollOttCa Enroll an identity via one-time-token with a pre-exchanged client certificate @@ -74,17 +74,15 @@ type EnrollOttCa struct { func (o *EnrollOttCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/enroll_ott_ca_parameters.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go similarity index 98% rename from rest_server/operations/enroll/enroll_ott_ca_parameters.go rename to rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go index f1a00006d..9f188bcc5 100644 --- a/rest_server/operations/enroll/enroll_ott_ca_parameters.go +++ b/rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewEnrollOttCaParams creates a new EnrollOttCaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollOttCaParams() EnrollOttCaParams { return EnrollOttCaParams{} @@ -77,7 +78,6 @@ func (o *EnrollOttCaParams) BindRequest(r *http.Request, route *middleware.Match if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -96,6 +96,7 @@ func (o *EnrollOttCaParams) bindToken(rawData []string, hasKey bool, formats str // Required: true // AllowEmptyValue: false + if err := validate.RequiredString("token", "query", raw); err != nil { return err } diff --git a/rest_server/operations/enroll/enroll_ott_ca_responses.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_responses.go similarity index 100% rename from rest_server/operations/enroll/enroll_ott_ca_responses.go rename to rest_client_api_server/operations/enroll/enroll_ott_ca_responses.go diff --git a/rest_server/operations/enroll/enroll_ott_ca_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/enroll_ott_ca_urlbuilder.go rename to rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go index aa11085ff..4a63814bb 100644 --- a/rest_server/operations/enroll/enroll_ott_ca_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go @@ -69,7 +69,7 @@ func (o *EnrollOttCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/enroll_ott_parameters.go b/rest_client_api_server/operations/enroll/enroll_ott_parameters.go similarity index 98% rename from rest_server/operations/enroll/enroll_ott_parameters.go rename to rest_client_api_server/operations/enroll/enroll_ott_parameters.go index fc2a602ea..a995f95b9 100644 --- a/rest_server/operations/enroll/enroll_ott_parameters.go +++ b/rest_client_api_server/operations/enroll/enroll_ott_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewEnrollOttParams creates a new EnrollOttParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollOttParams() EnrollOttParams { return EnrollOttParams{} @@ -77,7 +78,6 @@ func (o *EnrollOttParams) BindRequest(r *http.Request, route *middleware.Matched if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -96,6 +96,7 @@ func (o *EnrollOttParams) bindToken(rawData []string, hasKey bool, formats strfm // Required: true // AllowEmptyValue: false + if err := validate.RequiredString("token", "query", raw); err != nil { return err } diff --git a/rest_server/operations/enroll/enroll_ott_responses.go b/rest_client_api_server/operations/enroll/enroll_ott_responses.go similarity index 100% rename from rest_server/operations/enroll/enroll_ott_responses.go rename to rest_client_api_server/operations/enroll/enroll_ott_responses.go diff --git a/rest_server/operations/enroll/enroll_ott_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/enroll_ott_urlbuilder.go rename to rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go index 84bad886f..bcebdecda 100644 --- a/rest_server/operations/enroll/enroll_ott_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go @@ -69,7 +69,7 @@ func (o *EnrollOttURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/enroll_parameters.go b/rest_client_api_server/operations/enroll/enroll_parameters.go similarity index 98% rename from rest_server/operations/enroll/enroll_parameters.go rename to rest_client_api_server/operations/enroll/enroll_parameters.go index 6099a16cb..929c38103 100644 --- a/rest_server/operations/enroll/enroll_parameters.go +++ b/rest_client_api_server/operations/enroll/enroll_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewEnrollParams creates a new EnrollParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewEnrollParams() EnrollParams { return EnrollParams{} @@ -76,7 +77,6 @@ func (o *EnrollParams) BindRequest(r *http.Request, route *middleware.MatchedRou if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -92,6 +92,7 @@ func (o *EnrollParams) bindToken(rawData []string, hasKey bool, formats strfmt.R // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/enroll/enroll_responses.go b/rest_client_api_server/operations/enroll/enroll_responses.go similarity index 100% rename from rest_server/operations/enroll/enroll_responses.go rename to rest_client_api_server/operations/enroll/enroll_responses.go diff --git a/rest_server/operations/enroll/enroll_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/enroll_urlbuilder.go rename to rest_client_api_server/operations/enroll/enroll_urlbuilder.go index 6ae8e5afc..136dbb8bf 100644 --- a/rest_server/operations/enroll/enroll_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/enroll_urlbuilder.go @@ -69,7 +69,7 @@ func (o *EnrollURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/ernoll_updb.go b/rest_client_api_server/operations/enroll/ernoll_updb.go similarity index 97% rename from rest_server/operations/enroll/ernoll_updb.go rename to rest_client_api_server/operations/enroll/ernoll_updb.go index 39a3fba86..d144a7246 100644 --- a/rest_server/operations/enroll/ernoll_updb.go +++ b/rest_client_api_server/operations/enroll/ernoll_updb.go @@ -53,7 +53,7 @@ func NewErnollUpdb(ctx *middleware.Context, handler ErnollUpdbHandler) *ErnollUp return &ErnollUpdb{Context: ctx, Handler: handler} } -/*ErnollUpdb swagger:route POST /enroll/updb Enroll ernollUpdb +/* ErnollUpdb swagger:route POST /enroll/updb Enroll ernollUpdb Enroll an identity via one-time-token @@ -69,17 +69,15 @@ type ErnollUpdb struct { func (o *ErnollUpdb) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/ernoll_updb_parameters.go b/rest_client_api_server/operations/enroll/ernoll_updb_parameters.go similarity index 98% rename from rest_server/operations/enroll/ernoll_updb_parameters.go rename to rest_client_api_server/operations/enroll/ernoll_updb_parameters.go index 0540086e5..d55183c19 100644 --- a/rest_server/operations/enroll/ernoll_updb_parameters.go +++ b/rest_client_api_server/operations/enroll/ernoll_updb_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewErnollUpdbParams creates a new ErnollUpdbParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewErnollUpdbParams() ErnollUpdbParams { return ErnollUpdbParams{} @@ -77,7 +78,6 @@ func (o *ErnollUpdbParams) BindRequest(r *http.Request, route *middleware.Matche if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -96,6 +96,7 @@ func (o *ErnollUpdbParams) bindToken(rawData []string, hasKey bool, formats strf // Required: true // AllowEmptyValue: false + if err := validate.RequiredString("token", "query", raw); err != nil { return err } diff --git a/rest_server/operations/enroll/ernoll_updb_responses.go b/rest_client_api_server/operations/enroll/ernoll_updb_responses.go similarity index 100% rename from rest_server/operations/enroll/ernoll_updb_responses.go rename to rest_client_api_server/operations/enroll/ernoll_updb_responses.go diff --git a/rest_server/operations/enroll/ernoll_updb_urlbuilder.go b/rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/ernoll_updb_urlbuilder.go rename to rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go index d6af085a8..a947de267 100644 --- a/rest_server/operations/enroll/ernoll_updb_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go @@ -69,7 +69,7 @@ func (o *ErnollUpdbURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enroll/extend_router_enrollment.go b/rest_client_api_server/operations/enroll/extend_router_enrollment.go similarity index 96% rename from rest_server/operations/enroll/extend_router_enrollment.go rename to rest_client_api_server/operations/enroll/extend_router_enrollment.go index 25397a10e..1035cfcbd 100644 --- a/rest_server/operations/enroll/extend_router_enrollment.go +++ b/rest_client_api_server/operations/enroll/extend_router_enrollment.go @@ -53,7 +53,7 @@ func NewExtendRouterEnrollment(ctx *middleware.Context, handler ExtendRouterEnro return &ExtendRouterEnrollment{Context: ctx, Handler: handler} } -/*ExtendRouterEnrollment swagger:route POST /enroll/extend/router Enroll Extend Enrollment extendRouterEnrollment +/* ExtendRouterEnrollment swagger:route POST /enroll/extend/router Enroll Extend Enrollment extendRouterEnrollment Extend the life of a currently enrolled router's certificates @@ -77,17 +77,15 @@ type ExtendRouterEnrollment struct { func (o *ExtendRouterEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/enroll/extend_router_enrollment_parameters.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go similarity index 92% rename from rest_server/operations/enroll/extend_router_enrollment_parameters.go rename to rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go index 74b90ef14..f79ff3d30 100644 --- a/rest_server/operations/enroll/extend_router_enrollment_parameters.go +++ b/rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go @@ -30,18 +30,21 @@ package enroll // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewExtendRouterEnrollmentParams() ExtendRouterEnrollmentParams { return ExtendRouterEnrollmentParams{} @@ -87,6 +90,11 @@ func (o *ExtendRouterEnrollmentParams) BindRequest(r *http.Request, route *middl 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 } diff --git a/rest_server/operations/enroll/extend_router_enrollment_responses.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_responses.go similarity index 100% rename from rest_server/operations/enroll/extend_router_enrollment_responses.go rename to rest_client_api_server/operations/enroll/extend_router_enrollment_responses.go diff --git a/rest_server/operations/enroll/extend_router_enrollment_urlbuilder.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go similarity index 99% rename from rest_server/operations/enroll/extend_router_enrollment_urlbuilder.go rename to rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go index a42fd91a7..f49d9d621 100644 --- a/rest_server/operations/enroll/extend_router_enrollment_urlbuilder.go +++ b/rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ExtendRouterEnrollmentURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/detail_spec.go b/rest_client_api_server/operations/informational/detail_spec.go similarity index 96% rename from rest_server/operations/informational/detail_spec.go rename to rest_client_api_server/operations/informational/detail_spec.go index 3a2acc653..aee44fcb0 100644 --- a/rest_server/operations/informational/detail_spec.go +++ b/rest_client_api_server/operations/informational/detail_spec.go @@ -53,7 +53,7 @@ func NewDetailSpec(ctx *middleware.Context, handler DetailSpecHandler) *DetailSp return &DetailSpec{Context: ctx, Handler: handler} } -/*DetailSpec swagger:route GET /specs/{id} Informational detailSpec +/* DetailSpec swagger:route GET /specs/{id} Informational detailSpec Return a single spec resource @@ -68,17 +68,15 @@ type DetailSpec struct { func (o *DetailSpec) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/detail_spec_body.go b/rest_client_api_server/operations/informational/detail_spec_body.go similarity index 96% rename from rest_server/operations/informational/detail_spec_body.go rename to rest_client_api_server/operations/informational/detail_spec_body.go index 62b9107b4..31ebaf20c 100644 --- a/rest_server/operations/informational/detail_spec_body.go +++ b/rest_client_api_server/operations/informational/detail_spec_body.go @@ -53,7 +53,7 @@ func NewDetailSpecBody(ctx *middleware.Context, handler DetailSpecBodyHandler) * return &DetailSpecBody{Context: ctx, Handler: handler} } -/*DetailSpecBody swagger:route GET /specs/{id}/spec Informational detailSpecBody +/* DetailSpecBody swagger:route GET /specs/{id}/spec Informational detailSpecBody Returns the spec's file @@ -68,17 +68,15 @@ type DetailSpecBody struct { func (o *DetailSpecBody) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/detail_spec_body_parameters.go b/rest_client_api_server/operations/informational/detail_spec_body_parameters.go similarity index 98% rename from rest_server/operations/informational/detail_spec_body_parameters.go rename to rest_client_api_server/operations/informational/detail_spec_body_parameters.go index 1a6aa0223..94e9ee769 100644 --- a/rest_server/operations/informational/detail_spec_body_parameters.go +++ b/rest_client_api_server/operations/informational/detail_spec_body_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailSpecBodyParams creates a new DetailSpecBodyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailSpecBodyParams() DetailSpecBodyParams { return DetailSpecBodyParams{} @@ -73,7 +74,6 @@ func (o *DetailSpecBodyParams) BindRequest(r *http.Request, route *middleware.Ma if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailSpecBodyParams) bindID(rawData []string, hasKey bool, formats str // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/informational/detail_spec_body_responses.go b/rest_client_api_server/operations/informational/detail_spec_body_responses.go similarity index 100% rename from rest_server/operations/informational/detail_spec_body_responses.go rename to rest_client_api_server/operations/informational/detail_spec_body_responses.go diff --git a/rest_server/operations/informational/detail_spec_body_urlbuilder.go b/rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/detail_spec_body_urlbuilder.go rename to rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go index 61b3c9b46..40f9debc8 100644 --- a/rest_server/operations/informational/detail_spec_body_urlbuilder.go +++ b/rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailSpecBodyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/detail_spec_parameters.go b/rest_client_api_server/operations/informational/detail_spec_parameters.go similarity index 98% rename from rest_server/operations/informational/detail_spec_parameters.go rename to rest_client_api_server/operations/informational/detail_spec_parameters.go index 56c71a281..42c16cbcc 100644 --- a/rest_server/operations/informational/detail_spec_parameters.go +++ b/rest_client_api_server/operations/informational/detail_spec_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailSpecParams creates a new DetailSpecParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailSpecParams() DetailSpecParams { return DetailSpecParams{} @@ -73,7 +74,6 @@ func (o *DetailSpecParams) BindRequest(r *http.Request, route *middleware.Matche if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailSpecParams) bindID(rawData []string, hasKey bool, formats strfmt. // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/informational/detail_spec_responses.go b/rest_client_api_server/operations/informational/detail_spec_responses.go similarity index 100% rename from rest_server/operations/informational/detail_spec_responses.go rename to rest_client_api_server/operations/informational/detail_spec_responses.go diff --git a/rest_server/operations/informational/detail_spec_urlbuilder.go b/rest_client_api_server/operations/informational/detail_spec_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/detail_spec_urlbuilder.go rename to rest_client_api_server/operations/informational/detail_spec_urlbuilder.go index f1b8fcefb..24c6ecf78 100644 --- a/rest_server/operations/informational/detail_spec_urlbuilder.go +++ b/rest_client_api_server/operations/informational/detail_spec_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailSpecURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/list_protocols.go b/rest_client_api_server/operations/informational/list_protocols.go similarity index 96% rename from rest_server/operations/informational/list_protocols.go rename to rest_client_api_server/operations/informational/list_protocols.go index 6d85da921..d446c0d27 100644 --- a/rest_server/operations/informational/list_protocols.go +++ b/rest_client_api_server/operations/informational/list_protocols.go @@ -53,7 +53,7 @@ func NewListProtocols(ctx *middleware.Context, handler ListProtocolsHandler) *Li return &ListProtocols{Context: ctx, Handler: handler} } -/*ListProtocols swagger:route GET /protocols Informational listProtocols +/* ListProtocols swagger:route GET /protocols Informational listProtocols Return a list of the listening Edge protocols @@ -66,17 +66,15 @@ type ListProtocols struct { func (o *ListProtocols) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/list_protocols_parameters.go b/rest_client_api_server/operations/informational/list_protocols_parameters.go similarity index 97% rename from rest_server/operations/informational/list_protocols_parameters.go rename to rest_client_api_server/operations/informational/list_protocols_parameters.go index 93e1c4aa4..b98dd5b52 100644 --- a/rest_server/operations/informational/list_protocols_parameters.go +++ b/rest_client_api_server/operations/informational/list_protocols_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListProtocolsParams creates a new ListProtocolsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListProtocolsParams() ListProtocolsParams { return ListProtocolsParams{} diff --git a/rest_server/operations/informational/list_protocols_responses.go b/rest_client_api_server/operations/informational/list_protocols_responses.go similarity index 100% rename from rest_server/operations/informational/list_protocols_responses.go rename to rest_client_api_server/operations/informational/list_protocols_responses.go diff --git a/rest_server/operations/informational/list_protocols_urlbuilder.go b/rest_client_api_server/operations/informational/list_protocols_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/list_protocols_urlbuilder.go rename to rest_client_api_server/operations/informational/list_protocols_urlbuilder.go index 6307f9992..5128f1e0a 100644 --- a/rest_server/operations/informational/list_protocols_urlbuilder.go +++ b/rest_client_api_server/operations/informational/list_protocols_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListProtocolsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/list_root.go b/rest_client_api_server/operations/informational/list_root.go similarity index 97% rename from rest_server/operations/informational/list_root.go rename to rest_client_api_server/operations/informational/list_root.go index c79b9074f..9cc2d6cc5 100644 --- a/rest_server/operations/informational/list_root.go +++ b/rest_client_api_server/operations/informational/list_root.go @@ -53,7 +53,7 @@ func NewListRoot(ctx *middleware.Context, handler ListRootHandler) *ListRoot { return &ListRoot{Context: ctx, Handler: handler} } -/*ListRoot swagger:route GET / Informational listRoot +/* ListRoot swagger:route GET / Informational listRoot Returns version information @@ -66,17 +66,15 @@ type ListRoot struct { func (o *ListRoot) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/list_root_parameters.go b/rest_client_api_server/operations/informational/list_root_parameters.go similarity index 97% rename from rest_server/operations/informational/list_root_parameters.go rename to rest_client_api_server/operations/informational/list_root_parameters.go index 0429ad552..6944396e9 100644 --- a/rest_server/operations/informational/list_root_parameters.go +++ b/rest_client_api_server/operations/informational/list_root_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListRootParams creates a new ListRootParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListRootParams() ListRootParams { return ListRootParams{} diff --git a/rest_server/operations/informational/list_root_responses.go b/rest_client_api_server/operations/informational/list_root_responses.go similarity index 100% rename from rest_server/operations/informational/list_root_responses.go rename to rest_client_api_server/operations/informational/list_root_responses.go diff --git a/rest_server/operations/informational/list_root_urlbuilder.go b/rest_client_api_server/operations/informational/list_root_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/list_root_urlbuilder.go rename to rest_client_api_server/operations/informational/list_root_urlbuilder.go index d6227d10b..8263009fc 100644 --- a/rest_server/operations/informational/list_root_urlbuilder.go +++ b/rest_client_api_server/operations/informational/list_root_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListRootURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/list_specs.go b/rest_client_api_server/operations/informational/list_specs.go similarity index 97% rename from rest_server/operations/informational/list_specs.go rename to rest_client_api_server/operations/informational/list_specs.go index 4c612a452..ecbbb5313 100644 --- a/rest_server/operations/informational/list_specs.go +++ b/rest_client_api_server/operations/informational/list_specs.go @@ -53,7 +53,7 @@ func NewListSpecs(ctx *middleware.Context, handler ListSpecsHandler) *ListSpecs return &ListSpecs{Context: ctx, Handler: handler} } -/*ListSpecs swagger:route GET /specs Informational listSpecs +/* ListSpecs swagger:route GET /specs Informational listSpecs Returns a list of API specs @@ -68,17 +68,15 @@ type ListSpecs struct { func (o *ListSpecs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/list_specs_parameters.go b/rest_client_api_server/operations/informational/list_specs_parameters.go similarity index 97% rename from rest_server/operations/informational/list_specs_parameters.go rename to rest_client_api_server/operations/informational/list_specs_parameters.go index ad3dcaf3c..46fff39b6 100644 --- a/rest_server/operations/informational/list_specs_parameters.go +++ b/rest_client_api_server/operations/informational/list_specs_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListSpecsParams creates a new ListSpecsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListSpecsParams() ListSpecsParams { return ListSpecsParams{} diff --git a/rest_server/operations/informational/list_specs_responses.go b/rest_client_api_server/operations/informational/list_specs_responses.go similarity index 100% rename from rest_server/operations/informational/list_specs_responses.go rename to rest_client_api_server/operations/informational/list_specs_responses.go diff --git a/rest_server/operations/informational/list_specs_urlbuilder.go b/rest_client_api_server/operations/informational/list_specs_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/list_specs_urlbuilder.go rename to rest_client_api_server/operations/informational/list_specs_urlbuilder.go index 06ca9b64b..4c53f496c 100644 --- a/rest_server/operations/informational/list_specs_urlbuilder.go +++ b/rest_client_api_server/operations/informational/list_specs_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListSpecsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/informational/list_version.go b/rest_client_api_server/operations/informational/list_version.go similarity index 96% rename from rest_server/operations/informational/list_version.go rename to rest_client_api_server/operations/informational/list_version.go index 52d205a53..b253333c7 100644 --- a/rest_server/operations/informational/list_version.go +++ b/rest_client_api_server/operations/informational/list_version.go @@ -53,7 +53,7 @@ func NewListVersion(ctx *middleware.Context, handler ListVersionHandler) *ListVe return &ListVersion{Context: ctx, Handler: handler} } -/*ListVersion swagger:route GET /version Informational listVersion +/* ListVersion swagger:route GET /version Informational listVersion Returns version information @@ -66,17 +66,15 @@ type ListVersion struct { func (o *ListVersion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/informational/list_version_parameters.go b/rest_client_api_server/operations/informational/list_version_parameters.go similarity index 97% rename from rest_server/operations/informational/list_version_parameters.go rename to rest_client_api_server/operations/informational/list_version_parameters.go index e225ac0a8..efb65aac8 100644 --- a/rest_server/operations/informational/list_version_parameters.go +++ b/rest_client_api_server/operations/informational/list_version_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListVersionParams creates a new ListVersionParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListVersionParams() ListVersionParams { return ListVersionParams{} diff --git a/rest_server/operations/informational/list_version_responses.go b/rest_client_api_server/operations/informational/list_version_responses.go similarity index 100% rename from rest_server/operations/informational/list_version_responses.go rename to rest_client_api_server/operations/informational/list_version_responses.go diff --git a/rest_server/operations/informational/list_version_urlbuilder.go b/rest_client_api_server/operations/informational/list_version_urlbuilder.go similarity index 99% rename from rest_server/operations/informational/list_version_urlbuilder.go rename to rest_client_api_server/operations/informational/list_version_urlbuilder.go index 13d65593b..784d40b98 100644 --- a/rest_server/operations/informational/list_version_urlbuilder.go +++ b/rest_client_api_server/operations/informational/list_version_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListVersionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/create_posture_response.go b/rest_client_api_server/operations/posture_checks/create_posture_response.go similarity index 93% rename from rest_server/operations/posture_checks/create_posture_response.go rename to rest_client_api_server/operations/posture_checks/create_posture_response.go index 208e4264f..b790e07fe 100644 --- a/rest_server/operations/posture_checks/create_posture_response.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response.go @@ -53,7 +53,7 @@ func NewCreatePostureResponse(ctx *middleware.Context, handler CreatePostureResp return &CreatePostureResponse{Context: ctx, Handler: handler} } -/*CreatePostureResponse swagger:route POST /posture-response Posture Checks createPostureResponse +/* CreatePostureResponse swagger:route POST /posture-response Posture Checks createPostureResponse Submit a posture response to a posture query @@ -68,21 +68,20 @@ type CreatePostureResponse struct { func (o *CreatePostureResponse) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreatePostureResponse) ServeHTTP(rw http.ResponseWriter, r *http.Reques } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/create_posture_response_bulk.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go similarity index 93% rename from rest_server/operations/posture_checks/create_posture_response_bulk.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go index 9abf1ddf6..cc7377829 100644 --- a/rest_server/operations/posture_checks/create_posture_response_bulk.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go @@ -53,7 +53,7 @@ func NewCreatePostureResponseBulk(ctx *middleware.Context, handler CreatePosture return &CreatePostureResponseBulk{Context: ctx, Handler: handler} } -/*CreatePostureResponseBulk swagger:route POST /posture-response-bulk Posture Checks createPostureResponseBulk +/* CreatePostureResponseBulk swagger:route POST /posture-response-bulk Posture Checks createPostureResponseBulk Submit multiple posture responses @@ -68,21 +68,20 @@ type CreatePostureResponseBulk struct { func (o *CreatePostureResponseBulk) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreatePostureResponseBulk) ServeHTTP(rw http.ResponseWriter, r *http.Re } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/create_posture_response_bulk_parameters.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go similarity index 98% rename from rest_server/operations/posture_checks/create_posture_response_bulk_parameters.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go index 99c754ad6..66d5f7148 100644 --- a/rest_server/operations/posture_checks/create_posture_response_bulk_parameters.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go @@ -41,7 +41,8 @@ import ( ) // NewCreatePostureResponseBulkParams creates a new CreatePostureResponseBulkParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreatePostureResponseBulkParams() CreatePostureResponseBulkParams { return CreatePostureResponseBulkParams{} @@ -81,6 +82,7 @@ func (o *CreatePostureResponseBulkParams) BindRequest(r *http.Request, route *mi } res = append(res, err) } else { + // validate array of body objects for i := range body { if err := body[i].Validate(route.Formats); err != nil { @@ -88,6 +90,7 @@ func (o *CreatePostureResponseBulkParams) BindRequest(r *http.Request, route *mi break } } + if len(res) == 0 { o.PostureResponse = body } diff --git a/rest_server/operations/posture_checks/create_posture_response_bulk_responses.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_responses.go similarity index 100% rename from rest_server/operations/posture_checks/create_posture_response_bulk_responses.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_bulk_responses.go diff --git a/rest_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go similarity index 99% rename from rest_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go index e4db4614f..aa2938880 100644 --- a/rest_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreatePostureResponseBulkURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/create_posture_response_parameters.go b/rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go similarity index 92% rename from rest_server/operations/posture_checks/create_posture_response_parameters.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go index 7407c3dd0..c0f8c151f 100644 --- a/rest_server/operations/posture_checks/create_posture_response_parameters.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go @@ -30,18 +30,21 @@ package posture_checks // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreatePostureResponseParams() CreatePostureResponseParams { return CreatePostureResponseParams{} @@ -86,6 +89,11 @@ func (o *CreatePostureResponseParams) BindRequest(r *http.Request, route *middle 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 } diff --git a/rest_server/operations/posture_checks/create_posture_response_responses.go b/rest_client_api_server/operations/posture_checks/create_posture_response_responses.go similarity index 100% rename from rest_server/operations/posture_checks/create_posture_response_responses.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_responses.go diff --git a/rest_server/operations/posture_checks/create_posture_response_urlbuilder.go b/rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go similarity index 99% rename from rest_server/operations/posture_checks/create_posture_response_urlbuilder.go rename to rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go index 291d2b48d..4877846e8 100644 --- a/rest_server/operations/posture_checks/create_posture_response_urlbuilder.go +++ b/rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreatePostureResponseURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/delete_service.go b/rest_client_api_server/operations/service/delete_service.go similarity index 94% rename from rest_server/operations/service/delete_service.go rename to rest_client_api_server/operations/service/delete_service.go index a25c783fc..b1f007b17 100644 --- a/rest_server/operations/service/delete_service.go +++ b/rest_client_api_server/operations/service/delete_service.go @@ -53,7 +53,7 @@ func NewDeleteService(ctx *middleware.Context, handler DeleteServiceHandler) *De return &DeleteService{Context: ctx, Handler: handler} } -/*DeleteService swagger:route DELETE /services/{id} Service deleteService +/* DeleteService swagger:route DELETE /services/{id} Service deleteService Delete a service @@ -68,21 +68,20 @@ type DeleteService struct { func (o *DeleteService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/delete_service_parameters.go b/rest_client_api_server/operations/service/delete_service_parameters.go similarity index 98% rename from rest_server/operations/service/delete_service_parameters.go rename to rest_client_api_server/operations/service/delete_service_parameters.go index f5d2baafa..b58e95631 100644 --- a/rest_server/operations/service/delete_service_parameters.go +++ b/rest_client_api_server/operations/service/delete_service_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteServiceParams creates a new DeleteServiceParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteServiceParams() DeleteServiceParams { return DeleteServiceParams{} @@ -73,7 +74,6 @@ func (o *DeleteServiceParams) BindRequest(r *http.Request, route *middleware.Mat if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteServiceParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service/delete_service_responses.go b/rest_client_api_server/operations/service/delete_service_responses.go similarity index 100% rename from rest_server/operations/service/delete_service_responses.go rename to rest_client_api_server/operations/service/delete_service_responses.go diff --git a/rest_server/operations/service/delete_service_urlbuilder.go b/rest_client_api_server/operations/service/delete_service_urlbuilder.go similarity index 99% rename from rest_server/operations/service/delete_service_urlbuilder.go rename to rest_client_api_server/operations/service/delete_service_urlbuilder.go index 2c2c02ef4..0fc42235b 100644 --- a/rest_server/operations/service/delete_service_urlbuilder.go +++ b/rest_client_api_server/operations/service/delete_service_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteServiceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/detail_service.go b/rest_client_api_server/operations/service/detail_service.go similarity index 94% rename from rest_server/operations/service/detail_service.go rename to rest_client_api_server/operations/service/detail_service.go index 53392fe22..3516cfb7c 100644 --- a/rest_server/operations/service/detail_service.go +++ b/rest_client_api_server/operations/service/detail_service.go @@ -53,7 +53,7 @@ func NewDetailService(ctx *middleware.Context, handler DetailServiceHandler) *De return &DetailService{Context: ctx, Handler: handler} } -/*DetailService swagger:route GET /services/{id} Service detailService +/* DetailService swagger:route GET /services/{id} Service detailService Retrieves a single service @@ -68,21 +68,20 @@ type DetailService struct { func (o *DetailService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/detail_service_parameters.go b/rest_client_api_server/operations/service/detail_service_parameters.go similarity index 98% rename from rest_server/operations/service/detail_service_parameters.go rename to rest_client_api_server/operations/service/detail_service_parameters.go index 9bfe17da6..c7baaf646 100644 --- a/rest_server/operations/service/detail_service_parameters.go +++ b/rest_client_api_server/operations/service/detail_service_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailServiceParams creates a new DetailServiceParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailServiceParams() DetailServiceParams { return DetailServiceParams{} @@ -73,7 +74,6 @@ func (o *DetailServiceParams) BindRequest(r *http.Request, route *middleware.Mat if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailServiceParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service/detail_service_responses.go b/rest_client_api_server/operations/service/detail_service_responses.go similarity index 100% rename from rest_server/operations/service/detail_service_responses.go rename to rest_client_api_server/operations/service/detail_service_responses.go diff --git a/rest_server/operations/service/detail_service_urlbuilder.go b/rest_client_api_server/operations/service/detail_service_urlbuilder.go similarity index 99% rename from rest_server/operations/service/detail_service_urlbuilder.go rename to rest_client_api_server/operations/service/detail_service_urlbuilder.go index 9bf277e95..b73658768 100644 --- a/rest_server/operations/service/detail_service_urlbuilder.go +++ b/rest_client_api_server/operations/service/detail_service_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailServiceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_service_terminators.go b/rest_client_api_server/operations/service/list_service_terminators.go similarity index 93% rename from rest_server/operations/service/list_service_terminators.go rename to rest_client_api_server/operations/service/list_service_terminators.go index dd5e636ce..d668d4cd2 100644 --- a/rest_server/operations/service/list_service_terminators.go +++ b/rest_client_api_server/operations/service/list_service_terminators.go @@ -53,7 +53,7 @@ func NewListServiceTerminators(ctx *middleware.Context, handler ListServiceTermi return &ListServiceTerminators{Context: ctx, Handler: handler} } -/*ListServiceTerminators swagger:route GET /services/{id}/terminators Service listServiceTerminators +/* ListServiceTerminators swagger:route GET /services/{id}/terminators Service listServiceTerminators List of terminators assigned to a service @@ -69,21 +69,20 @@ type ListServiceTerminators struct { func (o *ListServiceTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_service_terminators_parameters.go b/rest_client_api_server/operations/service/list_service_terminators_parameters.go similarity index 98% rename from rest_server/operations/service/list_service_terminators_parameters.go rename to rest_client_api_server/operations/service/list_service_terminators_parameters.go index 90017d240..b7d66e76b 100644 --- a/rest_server/operations/service/list_service_terminators_parameters.go +++ b/rest_client_api_server/operations/service/list_service_terminators_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceTerminatorsParams() ListServiceTerminatorsParams { return ListServiceTerminatorsParams{} @@ -104,7 +105,6 @@ func (o *ListServiceTerminatorsParams) BindRequest(r *http.Request, route *middl if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceTerminatorsParams) bindFilter(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceTerminatorsParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceTerminatorsParams) bindLimit(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceTerminatorsParams) bindOffset(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations 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 new file mode 100644 index 000000000..b71484b85 --- /dev/null +++ b/rest_client_api_server/operations/service/list_service_terminators_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + } + } +} + +// 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_server/operations/service/list_service_terminators_urlbuilder.go b/rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_service_terminators_urlbuilder.go rename to rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go index a74e7a00d..9c06f3d0d 100644 --- a/rest_server/operations/service/list_service_terminators_urlbuilder.go +++ b/rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServiceTerminatorsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_services.go b/rest_client_api_server/operations/service/list_services.go similarity index 94% rename from rest_server/operations/service/list_services.go rename to rest_client_api_server/operations/service/list_services.go index 2a0a8c075..f8b48a763 100644 --- a/rest_server/operations/service/list_services.go +++ b/rest_client_api_server/operations/service/list_services.go @@ -53,7 +53,7 @@ func NewListServices(ctx *middleware.Context, handler ListServicesHandler) *List return &ListServices{Context: ctx, Handler: handler} } -/*ListServices swagger:route GET /services Service listServices +/* ListServices swagger:route GET /services Service listServices List services @@ -69,21 +69,20 @@ type ListServices struct { func (o *ListServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_services_parameters.go b/rest_client_api_server/operations/service/list_services_parameters.go similarity index 99% rename from rest_server/operations/service/list_services_parameters.go rename to rest_client_api_server/operations/service/list_services_parameters.go index 2fad57cf0..c69cc57e6 100644 --- a/rest_server/operations/service/list_services_parameters.go +++ b/rest_client_api_server/operations/service/list_services_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServicesParams creates a new ListServicesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServicesParams() ListServicesParams { return ListServicesParams{} @@ -113,7 +114,6 @@ func (o *ListServicesParams) BindRequest(r *http.Request, route *middleware.Matc if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -129,10 +129,10 @@ func (o *ListServicesParams) bindFilter(rawData []string, hasKey bool, formats s // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -147,6 +147,7 @@ func (o *ListServicesParams) bindLimit(rawData []string, hasKey bool, formats st // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -169,6 +170,7 @@ func (o *ListServicesParams) bindOffset(rawData []string, hasKey bool, formats s // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -186,10 +188,8 @@ func (o *ListServicesParams) bindOffset(rawData []string, hasKey bool, formats s // // 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 } @@ -215,10 +215,10 @@ func (o *ListServicesParams) bindRoleSemantic(rawData []string, hasKey bool, for // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.RoleSemantic = &raw return nil diff --git a/rest_server/operations/service/list_services_responses.go b/rest_client_api_server/operations/service/list_services_responses.go similarity index 100% rename from rest_server/operations/service/list_services_responses.go rename to rest_client_api_server/operations/service/list_services_responses.go diff --git a/rest_server/operations/service/list_services_urlbuilder.go b/rest_client_api_server/operations/service/list_services_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_services_urlbuilder.go rename to rest_client_api_server/operations/service/list_services_urlbuilder.go index 29ef14514..45181e736 100644 --- a/rest_server/operations/service/list_services_urlbuilder.go +++ b/rest_client_api_server/operations/service/list_services_urlbuilder.go @@ -73,7 +73,7 @@ func (o *ListServicesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/patch_service.go b/rest_client_api_server/operations/service/patch_service.go similarity index 94% rename from rest_server/operations/service/patch_service.go rename to rest_client_api_server/operations/service/patch_service.go index a2ab2f77f..fcf15a412 100644 --- a/rest_server/operations/service/patch_service.go +++ b/rest_client_api_server/operations/service/patch_service.go @@ -53,7 +53,7 @@ func NewPatchService(ctx *middleware.Context, handler PatchServiceHandler) *Patc return &PatchService{Context: ctx, Handler: handler} } -/*PatchService swagger:route PATCH /services/{id} Service patchService +/* PatchService swagger:route PATCH /services/{id} Service patchService Update the supplied fields on a service @@ -68,21 +68,20 @@ type PatchService struct { func (o *PatchService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/patch_service_parameters.go b/rest_client_api_server/operations/service/patch_service_parameters.go similarity index 93% rename from rest_server/operations/service/patch_service_parameters.go rename to rest_client_api_server/operations/service/patch_service_parameters.go index 5f7145821..c75558144 100644 --- a/rest_server/operations/service/patch_service_parameters.go +++ b/rest_client_api_server/operations/service/patch_service_parameters.go @@ -30,6 +30,7 @@ package service // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchServiceParams() PatchServiceParams { return PatchServiceParams{} @@ -98,6 +101,11 @@ func (o *PatchServiceParams) BindRequest(r *http.Request, route *middleware.Matc 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 } @@ -120,7 +128,6 @@ func (o *PatchServiceParams) bindID(rawData []string, hasKey bool, formats strfm // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service/patch_service_responses.go b/rest_client_api_server/operations/service/patch_service_responses.go similarity index 100% rename from rest_server/operations/service/patch_service_responses.go rename to rest_client_api_server/operations/service/patch_service_responses.go diff --git a/rest_server/operations/service/patch_service_urlbuilder.go b/rest_client_api_server/operations/service/patch_service_urlbuilder.go similarity index 99% rename from rest_server/operations/service/patch_service_urlbuilder.go rename to rest_client_api_server/operations/service/patch_service_urlbuilder.go index a4dd7c7bf..0091a1ecd 100644 --- a/rest_server/operations/service/patch_service_urlbuilder.go +++ b/rest_client_api_server/operations/service/patch_service_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchServiceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/update_service.go b/rest_client_api_server/operations/service/update_service.go similarity index 94% rename from rest_server/operations/service/update_service.go rename to rest_client_api_server/operations/service/update_service.go index 86458842d..43a4acd89 100644 --- a/rest_server/operations/service/update_service.go +++ b/rest_client_api_server/operations/service/update_service.go @@ -53,7 +53,7 @@ func NewUpdateService(ctx *middleware.Context, handler UpdateServiceHandler) *Up return &UpdateService{Context: ctx, Handler: handler} } -/*UpdateService swagger:route PUT /services/{id} Service updateService +/* UpdateService swagger:route PUT /services/{id} Service updateService Update all fields on a service @@ -68,21 +68,20 @@ type UpdateService struct { func (o *UpdateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/update_service_parameters.go b/rest_client_api_server/operations/service/update_service_parameters.go similarity index 93% rename from rest_server/operations/service/update_service_parameters.go rename to rest_client_api_server/operations/service/update_service_parameters.go index f1785bda1..6d8aacc72 100644 --- a/rest_server/operations/service/update_service_parameters.go +++ b/rest_client_api_server/operations/service/update_service_parameters.go @@ -30,6 +30,7 @@ package service // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateServiceParams() UpdateServiceParams { return UpdateServiceParams{} @@ -98,6 +101,11 @@ func (o *UpdateServiceParams) BindRequest(r *http.Request, route *middleware.Mat 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 } @@ -120,7 +128,6 @@ func (o *UpdateServiceParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service/update_service_responses.go b/rest_client_api_server/operations/service/update_service_responses.go similarity index 100% rename from rest_server/operations/service/update_service_responses.go rename to rest_client_api_server/operations/service/update_service_responses.go diff --git a/rest_server/operations/service/update_service_urlbuilder.go b/rest_client_api_server/operations/service/update_service_urlbuilder.go similarity index 99% rename from rest_server/operations/service/update_service_urlbuilder.go rename to rest_client_api_server/operations/service/update_service_urlbuilder.go index 1a23bc370..db8e6a213 100644 --- a/rest_server/operations/service/update_service_urlbuilder.go +++ b/rest_client_api_server/operations/service/update_service_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateServiceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/session/create_session.go b/rest_client_api_server/operations/session/create_session.go similarity index 93% rename from rest_server/operations/session/create_session.go rename to rest_client_api_server/operations/session/create_session.go index 3f5939cf2..5b6f5527f 100644 --- a/rest_server/operations/session/create_session.go +++ b/rest_client_api_server/operations/session/create_session.go @@ -53,11 +53,11 @@ func NewCreateSession(ctx *middleware.Context, handler CreateSessionHandler) *Cr return &CreateSession{Context: ctx, Handler: handler} } -/*CreateSession swagger:route POST /sessions Session createSession +/* CreateSession swagger:route POST /sessions Session createSession Create a session resource -Create a session resource. Requires admin access. +Create a session resource. */ type CreateSession struct { @@ -68,21 +68,20 @@ type CreateSession struct { func (o *CreateSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/session/create_session_parameters.go b/rest_client_api_server/operations/session/create_session_parameters.go similarity index 91% rename from rest_server/operations/session/create_session_parameters.go rename to rest_client_api_server/operations/session/create_session_parameters.go index 870279010..b1a1ee64d 100644 --- a/rest_server/operations/session/create_session_parameters.go +++ b/rest_client_api_server/operations/session/create_session_parameters.go @@ -30,18 +30,21 @@ package session // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateSessionParams() CreateSessionParams { return CreateSessionParams{} @@ -87,6 +90,11 @@ func (o *CreateSessionParams) BindRequest(r *http.Request, route *middleware.Mat 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 } diff --git a/rest_server/operations/session/create_session_responses.go b/rest_client_api_server/operations/session/create_session_responses.go similarity index 100% rename from rest_server/operations/session/create_session_responses.go rename to rest_client_api_server/operations/session/create_session_responses.go diff --git a/rest_server/operations/session/create_session_urlbuilder.go b/rest_client_api_server/operations/session/create_session_urlbuilder.go similarity index 99% rename from rest_server/operations/session/create_session_urlbuilder.go rename to rest_client_api_server/operations/session/create_session_urlbuilder.go index 43c1b389e..bb2bfa63d 100644 --- a/rest_server/operations/session/create_session_urlbuilder.go +++ b/rest_client_api_server/operations/session/create_session_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateSessionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_client_api_server/operations/session/delete_session.go b/rest_client_api_server/operations/session/delete_session.go new file mode 100644 index 000000000..d75807e82 --- /dev/null +++ b/rest_client_api_server/operations/session/delete_session.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/delete_session_parameters.go b/rest_client_api_server/operations/session/delete_session_parameters.go similarity index 98% rename from rest_server/operations/session/delete_session_parameters.go rename to rest_client_api_server/operations/session/delete_session_parameters.go index 9aa8c911a..3df23a714 100644 --- a/rest_server/operations/session/delete_session_parameters.go +++ b/rest_client_api_server/operations/session/delete_session_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteSessionParams creates a new DeleteSessionParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteSessionParams() DeleteSessionParams { return DeleteSessionParams{} @@ -73,7 +74,6 @@ func (o *DeleteSessionParams) BindRequest(r *http.Request, route *middleware.Mat if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteSessionParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/session/delete_session_responses.go b/rest_client_api_server/operations/session/delete_session_responses.go similarity index 100% rename from rest_server/operations/session/delete_session_responses.go rename to rest_client_api_server/operations/session/delete_session_responses.go diff --git a/rest_server/operations/session/delete_session_urlbuilder.go b/rest_client_api_server/operations/session/delete_session_urlbuilder.go similarity index 99% rename from rest_server/operations/session/delete_session_urlbuilder.go rename to rest_client_api_server/operations/session/delete_session_urlbuilder.go index 413cf0df5..283e19eb4 100644 --- a/rest_server/operations/session/delete_session_urlbuilder.go +++ b/rest_client_api_server/operations/session/delete_session_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteSessionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_client_api_server/operations/session/detail_session.go b/rest_client_api_server/operations/session/detail_session.go new file mode 100644 index 000000000..5098662e0 --- /dev/null +++ b/rest_client_api_server/operations/session/detail_session.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/detail_session_parameters.go b/rest_client_api_server/operations/session/detail_session_parameters.go similarity index 98% rename from rest_server/operations/session/detail_session_parameters.go rename to rest_client_api_server/operations/session/detail_session_parameters.go index 0fafc04f5..d0cdead74 100644 --- a/rest_server/operations/session/detail_session_parameters.go +++ b/rest_client_api_server/operations/session/detail_session_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailSessionParams creates a new DetailSessionParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailSessionParams() DetailSessionParams { return DetailSessionParams{} @@ -73,7 +74,6 @@ func (o *DetailSessionParams) BindRequest(r *http.Request, route *middleware.Mat if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailSessionParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/session/detail_session_responses.go b/rest_client_api_server/operations/session/detail_session_responses.go similarity index 100% rename from rest_server/operations/session/detail_session_responses.go rename to rest_client_api_server/operations/session/detail_session_responses.go diff --git a/rest_server/operations/session/detail_session_urlbuilder.go b/rest_client_api_server/operations/session/detail_session_urlbuilder.go similarity index 99% rename from rest_server/operations/session/detail_session_urlbuilder.go rename to rest_client_api_server/operations/session/detail_session_urlbuilder.go index 2062d08c6..8bfa44e71 100644 --- a/rest_server/operations/session/detail_session_urlbuilder.go +++ b/rest_client_api_server/operations/session/detail_session_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailSessionURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_client_api_server/operations/session/list_sessions.go b/rest_client_api_server/operations/session/list_sessions.go new file mode 100644 index 000000000..d9ef32632 --- /dev/null +++ b/rest_client_api_server/operations/session/list_sessions.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/list_sessions_parameters.go b/rest_client_api_server/operations/session/list_sessions_parameters.go similarity index 98% rename from rest_server/operations/session/list_sessions_parameters.go rename to rest_client_api_server/operations/session/list_sessions_parameters.go index 93ba35fcf..abfed115d 100644 --- a/rest_server/operations/session/list_sessions_parameters.go +++ b/rest_client_api_server/operations/session/list_sessions_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListSessionsParams creates a new ListSessionsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListSessionsParams() ListSessionsParams { return ListSessionsParams{} @@ -94,7 +95,6 @@ func (o *ListSessionsParams) BindRequest(r *http.Request, route *middleware.Matc if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListSessionsParams) bindFilter(rawData []string, hasKey bool, formats s // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListSessionsParams) bindLimit(rawData []string, hasKey bool, formats st // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListSessionsParams) bindOffset(rawData []string, hasKey bool, formats s // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/session/list_sessions_responses.go b/rest_client_api_server/operations/session/list_sessions_responses.go similarity index 100% rename from rest_server/operations/session/list_sessions_responses.go rename to rest_client_api_server/operations/session/list_sessions_responses.go diff --git a/rest_server/operations/session/list_sessions_urlbuilder.go b/rest_client_api_server/operations/session/list_sessions_urlbuilder.go similarity index 99% rename from rest_server/operations/session/list_sessions_urlbuilder.go rename to rest_client_api_server/operations/session/list_sessions_urlbuilder.go index 84353aade..691b63ef3 100644 --- a/rest_server/operations/session/list_sessions_urlbuilder.go +++ b/rest_client_api_server/operations/session/list_sessions_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListSessionsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/well_known/list_well_known_cas.go b/rest_client_api_server/operations/well_known/list_well_known_cas.go similarity index 96% rename from rest_server/operations/well_known/list_well_known_cas.go rename to rest_client_api_server/operations/well_known/list_well_known_cas.go index 03f11a663..274613103 100644 --- a/rest_server/operations/well_known/list_well_known_cas.go +++ b/rest_client_api_server/operations/well_known/list_well_known_cas.go @@ -53,7 +53,7 @@ func NewListWellKnownCas(ctx *middleware.Context, handler ListWellKnownCasHandle return &ListWellKnownCas{Context: ctx, Handler: handler} } -/*ListWellKnownCas swagger:route GET /.well-known/est/cacerts Well Known listWellKnownCas +/* ListWellKnownCas swagger:route GET /.well-known/est/cacerts Well Known listWellKnownCas Get CA Cert Store @@ -71,17 +71,15 @@ type ListWellKnownCas struct { func (o *ListWellKnownCas) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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_server/operations/well_known/list_well_known_cas_parameters.go b/rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go similarity index 97% rename from rest_server/operations/well_known/list_well_known_cas_parameters.go rename to rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go index 73ba1b95c..89c44bee0 100644 --- a/rest_server/operations/well_known/list_well_known_cas_parameters.go +++ b/rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListWellKnownCasParams creates a new ListWellKnownCasParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListWellKnownCasParams() ListWellKnownCasParams { return ListWellKnownCasParams{} diff --git a/rest_server/operations/well_known/list_well_known_cas_responses.go b/rest_client_api_server/operations/well_known/list_well_known_cas_responses.go similarity index 100% rename from rest_server/operations/well_known/list_well_known_cas_responses.go rename to rest_client_api_server/operations/well_known/list_well_known_cas_responses.go diff --git a/rest_server/operations/well_known/list_well_known_cas_urlbuilder.go b/rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go similarity index 99% rename from rest_server/operations/well_known/list_well_known_cas_urlbuilder.go rename to rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go index e11bfd937..038706686 100644 --- a/rest_server/operations/well_known/list_well_known_cas_urlbuilder.go +++ b/rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListWellKnownCasURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/client/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_client_api_server/operations/ziti_edge_client_api.go b/rest_client_api_server/operations/ziti_edge_client_api.go new file mode 100644 index 000000000..8979c5c22 --- /dev/null +++ b/rest_client_api_server/operations/ziti_edge_client_api.go @@ -0,0 +1,1011 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/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") + }), + EnrollExtendRouterEnrollmentHandler: enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { + return middleware.NotImplemented("operation enroll.ExtendRouterEnrollment 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") + }), + 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 the ziti 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 + // EnrollExtendRouterEnrollmentHandler sets the operation handler for the extend router enrollment operation + EnrollExtendRouterEnrollmentHandler enroll.ExtendRouterEnrollmentHandler + // 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 + // 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.EnrollExtendRouterEnrollmentHandler == nil { + unregistered = append(unregistered, "enroll.ExtendRouterEnrollmentHandler") + } + 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.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"]["/enroll/extend/router"] = enroll.NewExtendRouterEnrollment(o.context, o.EnrollExtendRouterEnrollmentHandler) + 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"]["/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_server/server.go b/rest_client_api_server/server.go similarity index 94% rename from rest_server/server.go rename to rest_client_api_server/server.go index fefb4c7f4..d69d55904 100644 --- a/rest_server/server.go +++ b/rest_client_api_server/server.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package rest_server +package rest_client_api_server import ( "context" @@ -49,7 +49,7 @@ import ( flags "github.com/jessevdk/go-flags" "golang.org/x/net/netutil" - "github.com/openziti/edge/rest_server/operations" + "github.com/openziti/edge/rest_client_api_server/operations" ) const ( @@ -66,8 +66,8 @@ func init() { } } -// NewServer creates a new api ziti edge server but does not configure it -func NewServer(api *operations.ZitiEdgeAPI) *Server { +// 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{}) @@ -90,14 +90,14 @@ func (s *Server) ConfigureFlags() { } } -// Server for the ziti edge 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.sock"` + 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"` @@ -119,7 +119,7 @@ type Server struct { TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` httpsServerL net.Listener - api *operations.ZitiEdgeAPI + api *operations.ZitiEdgeClientAPI handler http.Handler hasListeners bool shutdown chan struct{} @@ -149,7 +149,7 @@ func (s *Server) Fatalf(f string, args ...interface{}) { } // SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *operations.ZitiEdgeAPI) { +func (s *Server) SetAPI(api *operations.ZitiEdgeClientAPI) { if api == nil { s.api = nil s.handler = nil @@ -210,13 +210,13 @@ func (s *Server) Serve() (err error) { servers = append(servers, domainSocket) wg.Add(1) - s.Logf("Serving ziti edge at unix://%s", s.SocketPath) + 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 at unix://%s", s.SocketPath) + s.Logf("Stopped serving ziti edge client at unix://%s", s.SocketPath) }(s.domainSocketL) } @@ -240,13 +240,13 @@ func (s *Server) Serve() (err error) { servers = append(servers, httpServer) wg.Add(1) - s.Logf("Serving ziti edge at http://%s", s.httpServerL.Addr()) + 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 at http://%s", l.Addr()) + s.Logf("Stopped serving ziti edge client at http://%s", l.Addr()) }(s.httpServerL) } @@ -336,13 +336,13 @@ func (s *Server) Serve() (err error) { servers = append(servers, httpsServer) wg.Add(1) - s.Logf("Serving ziti edge at https://%s", s.httpsServerL.Addr()) + 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 at https://%s", l.Addr()) + s.Logf("Stopped serving ziti edge client at https://%s", l.Addr()) }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) } diff --git a/rest_client/api_session/api_session_client.go b/rest_management_api_client/api_session/api_session_client.go similarity index 85% rename from rest_client/api_session/api_session_client.go rename to rest_management_api_client/api_session/api_session_client.go index 09d08bddb..355c2e063 100644 --- a/rest_client/api_session/api_session_client.go +++ b/rest_management_api_client/api_session/api_session_client.go @@ -49,13 +49,16 @@ type Client struct { 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) (*DeleteAPISessionsOK, error) + DeleteAPISessions(params *DeleteAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPISessionsOK, error) - DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter) (*DetailAPISessionsOK, error) + DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAPISessionsOK, error) - ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAPISessionsOK, error) + ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAPISessionsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -65,13 +68,12 @@ type ClientService interface { Deletes and API sesion by id. Requires admin access. */ -func (a *Client) DeleteAPISessions(params *DeleteAPISessionsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAPISessionsOK, error) { +func (a *Client) DeleteAPISessions(params *DeleteAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPISessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAPISessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAPISessions", Method: "DELETE", PathPattern: "/api-sessions/{id}", @@ -83,7 +85,12 @@ func (a *Client) DeleteAPISessions(params *DeleteAPISessionsParams, authInfo run 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 } @@ -102,13 +109,12 @@ func (a *Client) DeleteAPISessions(params *DeleteAPISessionsParams, authInfo run Retrieves a single API Session by id. Requires admin access. */ -func (a *Client) DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter) (*DetailAPISessionsOK, error) { +func (a *Client) DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAPISessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailAPISessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailAPISessions", Method: "GET", PathPattern: "/api-sessions/{id}", @@ -120,7 +126,12 @@ func (a *Client) DetailAPISessions(params *DetailAPISessionsParams, authInfo run 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 } @@ -141,13 +152,12 @@ func (a *Client) DetailAPISessions(params *DetailAPISessionsParams, authInfo run requries admin access. */ -func (a *Client) ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAPISessionsOK, error) { +func (a *Client) ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAPISessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListAPISessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listAPISessions", Method: "GET", PathPattern: "/api-sessions", @@ -159,7 +169,12 @@ func (a *Client) ListAPISessions(params *ListAPISessionsParams, authInfo runtime 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 } diff --git a/rest_client/api_session/delete_api_sessions_parameters.go b/rest_management_api_client/api_session/delete_api_sessions_parameters.go similarity index 78% rename from rest_client/api_session/delete_api_sessions_parameters.go rename to rest_management_api_client/api_session/delete_api_sessions_parameters.go index bc9c70b85..7da62a0d1 100644 --- a/rest_client/api_session/delete_api_sessions_parameters.go +++ b/rest_management_api_client/api_session/delete_api_sessions_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAPISessionsParams creates a new DeleteAPISessionsParams object -// with the default values initialized. +// 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 { - var () return &DeleteAPISessionsParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAPISessionsParamsWithTimeout creates a new DeleteAPISessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAPISessionsParamsWithTimeout(timeout time.Duration) *DeleteAPISessionsParams { - var () return &DeleteAPISessionsParams{ - timeout: timeout, } } // NewDeleteAPISessionsParamsWithContext creates a new DeleteAPISessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAPISessionsParamsWithContext(ctx context.Context) *DeleteAPISessionsParams { - var () return &DeleteAPISessionsParams{ - Context: ctx, } } // NewDeleteAPISessionsParamsWithHTTPClient creates a new DeleteAPISessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAPISessionsParamsWithHTTPClient(client *http.Client) *DeleteAPISessionsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteAPISessionsParams struct { 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) diff --git a/rest_client/api_session/delete_api_sessions_responses.go b/rest_management_api_client/api_session/delete_api_sessions_responses.go similarity index 94% rename from rest_client/api_session/delete_api_sessions_responses.go rename to rest_management_api_client/api_session/delete_api_sessions_responses.go index 4bb1d6bad..514281143 100644 --- a/rest_client/api_session/delete_api_sessions_responses.go +++ b/rest_management_api_client/api_session/delete_api_sessions_responses.go @@ -65,7 +65,6 @@ func (o *DeleteAPISessionsReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewDeleteAPISessionsOK() *DeleteAPISessionsOK { return &DeleteAPISessionsOK{} } -/*DeleteAPISessionsOK handles this case with default header values. +/* DeleteAPISessionsOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeleteAPISessionsOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteAPISessionsForbidden() *DeleteAPISessionsForbidden { return &DeleteAPISessionsForbidden{} } -/*DeleteAPISessionsForbidden handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteAPISessionsForbidden struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteAPISessionsNotFound() *DeleteAPISessionsNotFound { return &DeleteAPISessionsNotFound{} } -/*DeleteAPISessionsNotFound handles this case with default header values. +/* DeleteAPISessionsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DeleteAPISessionsNotFound struct { 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 } diff --git a/rest_client/api_session/detail_api_sessions_parameters.go b/rest_management_api_client/api_session/detail_api_sessions_parameters.go similarity index 78% rename from rest_client/api_session/detail_api_sessions_parameters.go rename to rest_management_api_client/api_session/detail_api_sessions_parameters.go index a6521e4f7..833eefc0b 100644 --- a/rest_client/api_session/detail_api_sessions_parameters.go +++ b/rest_management_api_client/api_session/detail_api_sessions_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailAPISessionsParams creates a new DetailAPISessionsParams object -// with the default values initialized. +// 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 { - var () return &DetailAPISessionsParams{ - timeout: cr.DefaultTimeout, } } // NewDetailAPISessionsParamsWithTimeout creates a new DetailAPISessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailAPISessionsParamsWithTimeout(timeout time.Duration) *DetailAPISessionsParams { - var () return &DetailAPISessionsParams{ - timeout: timeout, } } // NewDetailAPISessionsParamsWithContext creates a new DetailAPISessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailAPISessionsParamsWithContext(ctx context.Context) *DetailAPISessionsParams { - var () return &DetailAPISessionsParams{ - Context: ctx, } } // NewDetailAPISessionsParamsWithHTTPClient creates a new DetailAPISessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailAPISessionsParamsWithHTTPClient(client *http.Client) *DetailAPISessionsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailAPISessionsParams struct { 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) diff --git a/rest_client/api_session/detail_api_sessions_responses.go b/rest_management_api_client/api_session/detail_api_sessions_responses.go similarity index 94% rename from rest_client/api_session/detail_api_sessions_responses.go rename to rest_management_api_client/api_session/detail_api_sessions_responses.go index e29b9ee52..8872a65c8 100644 --- a/rest_client/api_session/detail_api_sessions_responses.go +++ b/rest_management_api_client/api_session/detail_api_sessions_responses.go @@ -65,7 +65,6 @@ func (o *DetailAPISessionsReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewDetailAPISessionsOK() *DetailAPISessionsOK { return &DetailAPISessionsOK{} } -/*DetailAPISessionsOK handles this case with default header values. +/* DetailAPISessionsOK describes a response with status code 200, with default header values. Retrieves a singular API Session by id */ @@ -87,7 +86,6 @@ type DetailAPISessionsOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailAPISessionsUnauthorized() *DetailAPISessionsUnauthorized { return &DetailAPISessionsUnauthorized{} } -/*DetailAPISessionsUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailAPISessionsUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailAPISessionsNotFound() *DetailAPISessionsNotFound { return &DetailAPISessionsNotFound{} } -/*DetailAPISessionsNotFound handles this case with default header values. +/* DetailAPISessionsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailAPISessionsNotFound struct { 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 } diff --git a/rest_client/api_session/list_api_sessions_parameters.go b/rest_management_api_client/api_session/list_api_sessions_parameters.go similarity index 83% rename from rest_client/api_session/list_api_sessions_parameters.go rename to rest_management_api_client/api_session/list_api_sessions_parameters.go index e8adf53b1..a212d1e51 100644 --- a/rest_client/api_session/list_api_sessions_parameters.go +++ b/rest_management_api_client/api_session/list_api_sessions_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListAPISessionsParams creates a new ListAPISessionsParams object -// with the default values initialized. +// 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 { - var () return &ListAPISessionsParams{ - timeout: cr.DefaultTimeout, } } // NewListAPISessionsParamsWithTimeout creates a new ListAPISessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListAPISessionsParamsWithTimeout(timeout time.Duration) *ListAPISessionsParams { - var () return &ListAPISessionsParams{ - timeout: timeout, } } // NewListAPISessionsParamsWithContext creates a new ListAPISessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListAPISessionsParamsWithContext(ctx context.Context) *ListAPISessionsParams { - var () return &ListAPISessionsParams{ - Context: ctx, } } // NewListAPISessionsParamsWithHTTPClient creates a new ListAPISessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListAPISessionsParamsWithHTTPClient(client *http.Client) *ListAPISessionsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListAPISessionsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListAPISessionsParams) WriteToRequest(r runtime.ClientRequest, reg strf // 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 { diff --git a/rest_client/api_session/list_api_sessions_responses.go b/rest_management_api_client/api_session/list_api_sessions_responses.go similarity index 96% rename from rest_client/api_session/list_api_sessions_responses.go rename to rest_management_api_client/api_session/list_api_sessions_responses.go index 96663c10b..4abdf78de 100644 --- a/rest_client/api_session/list_api_sessions_responses.go +++ b/rest_management_api_client/api_session/list_api_sessions_responses.go @@ -53,7 +53,6 @@ func (o *ListAPISessionsReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -64,7 +63,7 @@ func NewListAPISessionsOK() *ListAPISessionsOK { return &ListAPISessionsOK{} } -/*ListAPISessionsOK handles this case with default header values. +/* ListAPISessionsOK describes a response with status code 200, with default header values. A list of active API Sessions */ @@ -75,7 +74,6 @@ type ListAPISessionsOK struct { 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 } diff --git a/rest_management_api_client/authentication/authenticate_mfa_parameters.go b/rest_management_api_client/authentication/authenticate_mfa_parameters.go new file mode 100644 index 000000000..432445cd6 --- /dev/null +++ b/rest_management_api_client/authentication/authenticate_mfa_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..76942192d --- /dev/null +++ b/rest_management_api_client/authentication/authenticate_mfa_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c1ac770f0 --- /dev/null +++ b/rest_management_api_client/authentication/authenticate_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..7f21110e6 --- /dev/null +++ b/rest_management_api_client/authentication/authenticate_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/geo_region/geo_region_client.go b/rest_management_api_client/authentication/authentication_client.go similarity index 59% rename from rest_client/geo_region/geo_region_client.go rename to rest_management_api_client/authentication/authentication_client.go index 367153bfb..ad1c247d2 100644 --- a/rest_client/geo_region/geo_region_client.go +++ b/rest_management_api_client/authentication/authentication_client.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package authentication // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -36,100 +36,110 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new geo region API client. +// New creates a new authentication API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for geo region API +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 { - DetailGeoRegion(params *DetailGeoRegionParams, authInfo runtime.ClientAuthInfoWriter) (*DetailGeoRegionOK, error) + Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) - ListGeoRegions(params *ListGeoRegionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListGeoRegionsOK, error) + AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) SetTransport(transport runtime.ClientTransport) } /* - DetailGeoRegion retrieves a geo region + Authenticate authenticates via a method supplied via a query string parameter + + Allows authentication Methods include "password" and "cert" - Retrieves a single geo-region by id. Requires admin access. */ -func (a *Client) DetailGeoRegion(params *DetailGeoRegionParams, authInfo runtime.ClientAuthInfoWriter) (*DetailGeoRegionOK, error) { +func (a *Client) Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDetailGeoRegionParams() + params = NewAuthenticateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "detailGeoRegion", - Method: "GET", - PathPattern: "/geo-regions/{id}", + op := &runtime.ClientOperation{ + ID: "authenticate", + Method: "POST", + PathPattern: "/authenticate", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DetailGeoRegionReader{formats: a.formats}, - AuthInfo: authInfo, + 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.(*DetailGeoRegionOK) + 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 detailGeoRegion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + 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) } /* - ListGeoRegions lists available geo regions - - Retrieves a list of geo-regions; supports filtering, sorting, and pagination. Requires admin access. + AuthenticateMfa completes m f a authentication + Completes MFA authentication by submitting a MFA time based one time token or backup code. */ -func (a *Client) ListGeoRegions(params *ListGeoRegionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListGeoRegionsOK, error) { +func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewListGeoRegionsParams() + params = NewAuthenticateMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "listGeoRegions", - Method: "GET", - PathPattern: "/geo-regions", + op := &runtime.ClientOperation{ + ID: "authenticateMfa", + Method: "POST", + PathPattern: "/authenticate/mfa", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &ListGeoRegionsReader{formats: a.formats}, + 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.(*ListGeoRegionsOK) + 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 listGeoRegions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + 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) } diff --git a/rest_client/authenticator/authenticator_client.go b/rest_management_api_client/authenticator/authenticator_client.go similarity index 83% rename from rest_client/authenticator/authenticator_client.go rename to rest_management_api_client/authenticator/authenticator_client.go index 37bb55df7..6e17552fb 100644 --- a/rest_client/authenticator/authenticator_client.go +++ b/rest_management_api_client/authenticator/authenticator_client.go @@ -49,19 +49,22 @@ type Client struct { 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) (*CreateAuthenticatorCreated, error) + CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error) - DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAuthenticatorOK, error) + DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error) - DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailAuthenticatorOK, error) + DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error) - ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAuthenticatorsOK, error) + ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error) - PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchAuthenticatorOK, error) + PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error) - UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAuthenticatorOK, error) + UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error) SetTransport(transport runtime.ClientTransport) } @@ -72,13 +75,12 @@ type ClientService interface { Creates an authenticator for a specific identity. Requires admin access. */ -func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAuthenticatorCreated, error) { +func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createAuthenticator", Method: "POST", PathPattern: "/authenticators", @@ -90,7 +92,12 @@ func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo 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 } @@ -111,13 +118,12 @@ func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo Requires admin access. */ -func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAuthenticatorOK, error) { +func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteAuthenticator", Method: "DELETE", PathPattern: "/authenticators/{id}", @@ -129,7 +135,12 @@ func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo 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 } @@ -148,13 +159,12 @@ func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo Retrieves a single authenticator by id. Requires admin access. */ -func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailAuthenticatorOK, error) { +func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailAuthenticator", Method: "GET", PathPattern: "/authenticators/{id}", @@ -166,7 +176,12 @@ func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo 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 } @@ -187,13 +202,12 @@ func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo This endpoint requries admin access. */ -func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAuthenticatorsOK, error) { +func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListAuthenticatorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listAuthenticators", Method: "GET", PathPattern: "/authenticators", @@ -205,7 +219,12 @@ func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo r 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 } @@ -224,13 +243,12 @@ func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo r Update the supplied fields on an authenticator by id. Requires admin access. */ -func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchAuthenticatorOK, error) { +func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchAuthenticator", Method: "PATCH", PathPattern: "/authenticators/{id}", @@ -242,7 +260,12 @@ func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo r 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 } @@ -261,13 +284,12 @@ func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo r Update all fields on an authenticator by id. Requires admin access. */ -func (a *Client) UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAuthenticatorOK, error) { +func (a *Client) UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAuthenticatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateAuthenticator", Method: "PUT", PathPattern: "/authenticators/{id}", @@ -279,7 +301,12 @@ func (a *Client) UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo 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 } diff --git a/rest_client/authenticator/create_authenticator_parameters.go b/rest_management_api_client/authenticator/create_authenticator_parameters.go similarity index 79% rename from rest_client/authenticator/create_authenticator_parameters.go rename to rest_management_api_client/authenticator/create_authenticator_parameters.go index eeab1fea2..c86a681ac 100644 --- a/rest_client/authenticator/create_authenticator_parameters.go +++ b/rest_management_api_client/authenticator/create_authenticator_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateAuthenticatorParams creates a new CreateAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &CreateAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAuthenticatorParamsWithTimeout creates a new CreateAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAuthenticatorParamsWithTimeout(timeout time.Duration) *CreateAuthenticatorParams { - var () return &CreateAuthenticatorParams{ - timeout: timeout, } } // NewCreateAuthenticatorParamsWithContext creates a new CreateAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAuthenticatorParamsWithContext(ctx context.Context) *CreateAuthenticatorParams { - var () return &CreateAuthenticatorParams{ - Context: ctx, } } // NewCreateAuthenticatorParamsWithHTTPClient creates a new CreateAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAuthenticatorParamsWithHTTPClient(client *http.Client) *CreateAuthenticatorParams { - var () 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 +/* 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. + A Authenticator create object */ Authenticator *rest_model.AuthenticatorCreate @@ -97,6 +96,21 @@ type CreateAuthenticatorParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Authenticator != nil { if err := r.SetBodyParam(o.Authenticator); err != nil { return err diff --git a/rest_client/authenticator/create_authenticator_responses.go b/rest_management_api_client/authenticator/create_authenticator_responses.go similarity index 94% rename from rest_client/authenticator/create_authenticator_responses.go rename to rest_management_api_client/authenticator/create_authenticator_responses.go index 26a7176c3..ba460f338 100644 --- a/rest_client/authenticator/create_authenticator_responses.go +++ b/rest_management_api_client/authenticator/create_authenticator_responses.go @@ -65,7 +65,6 @@ func (o *CreateAuthenticatorReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewCreateAuthenticatorCreated() *CreateAuthenticatorCreated { return &CreateAuthenticatorCreated{} } -/*CreateAuthenticatorCreated handles this case with default header values. +/* CreateAuthenticatorCreated describes a response with status code 201, with default header values. The create was successful */ @@ -87,7 +86,6 @@ type CreateAuthenticatorCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateAuthenticatorBadRequest() *CreateAuthenticatorBadRequest { return &CreateAuthenticatorBadRequest{} } -/*CreateAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateAuthenticatorBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateAuthenticatorUnauthorized() *CreateAuthenticatorUnauthorized { return &CreateAuthenticatorUnauthorized{} } -/*CreateAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateAuthenticatorUnauthorized struct { 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 } diff --git a/rest_client/authenticator/delete_authenticator_parameters.go b/rest_management_api_client/authenticator/delete_authenticator_parameters.go similarity index 78% rename from rest_client/authenticator/delete_authenticator_parameters.go rename to rest_management_api_client/authenticator/delete_authenticator_parameters.go index b14b94805..854f5be92 100644 --- a/rest_client/authenticator/delete_authenticator_parameters.go +++ b/rest_management_api_client/authenticator/delete_authenticator_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAuthenticatorParams creates a new DeleteAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &DeleteAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAuthenticatorParamsWithTimeout creates a new DeleteAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAuthenticatorParamsWithTimeout(timeout time.Duration) *DeleteAuthenticatorParams { - var () return &DeleteAuthenticatorParams{ - timeout: timeout, } } // NewDeleteAuthenticatorParamsWithContext creates a new DeleteAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAuthenticatorParamsWithContext(ctx context.Context) *DeleteAuthenticatorParams { - var () return &DeleteAuthenticatorParams{ - Context: ctx, } } // NewDeleteAuthenticatorParamsWithHTTPClient creates a new DeleteAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAuthenticatorParamsWithHTTPClient(client *http.Client) *DeleteAuthenticatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteAuthenticatorParams struct { 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) diff --git a/rest_client/authenticator/delete_authenticator_responses.go b/rest_management_api_client/authenticator/delete_authenticator_responses.go similarity index 94% rename from rest_client/authenticator/delete_authenticator_responses.go rename to rest_management_api_client/authenticator/delete_authenticator_responses.go index 42472045a..6def839b3 100644 --- a/rest_client/authenticator/delete_authenticator_responses.go +++ b/rest_management_api_client/authenticator/delete_authenticator_responses.go @@ -65,7 +65,6 @@ func (o *DeleteAuthenticatorReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewDeleteAuthenticatorOK() *DeleteAuthenticatorOK { return &DeleteAuthenticatorOK{} } -/*DeleteAuthenticatorOK handles this case with default header values. +/* DeleteAuthenticatorOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeleteAuthenticatorOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteAuthenticatorBadRequest() *DeleteAuthenticatorBadRequest { return &DeleteAuthenticatorBadRequest{} } -/*DeleteAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteAuthenticatorBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteAuthenticatorUnauthorized() *DeleteAuthenticatorUnauthorized { return &DeleteAuthenticatorUnauthorized{} } -/*DeleteAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type DeleteAuthenticatorUnauthorized struct { 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 } diff --git a/rest_client/authenticator/detail_authenticator_parameters.go b/rest_management_api_client/authenticator/detail_authenticator_parameters.go similarity index 78% rename from rest_client/authenticator/detail_authenticator_parameters.go rename to rest_management_api_client/authenticator/detail_authenticator_parameters.go index a88b9ca2f..50ce759aa 100644 --- a/rest_client/authenticator/detail_authenticator_parameters.go +++ b/rest_management_api_client/authenticator/detail_authenticator_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailAuthenticatorParams creates a new DetailAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &DetailAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewDetailAuthenticatorParamsWithTimeout creates a new DetailAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailAuthenticatorParamsWithTimeout(timeout time.Duration) *DetailAuthenticatorParams { - var () return &DetailAuthenticatorParams{ - timeout: timeout, } } // NewDetailAuthenticatorParamsWithContext creates a new DetailAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailAuthenticatorParamsWithContext(ctx context.Context) *DetailAuthenticatorParams { - var () return &DetailAuthenticatorParams{ - Context: ctx, } } // NewDetailAuthenticatorParamsWithHTTPClient creates a new DetailAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailAuthenticatorParamsWithHTTPClient(client *http.Client) *DetailAuthenticatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailAuthenticatorParams struct { 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) diff --git a/rest_client/authenticator/detail_authenticator_responses.go b/rest_management_api_client/authenticator/detail_authenticator_responses.go similarity index 94% rename from rest_client/authenticator/detail_authenticator_responses.go rename to rest_management_api_client/authenticator/detail_authenticator_responses.go index 577ef5d74..41f410440 100644 --- a/rest_client/authenticator/detail_authenticator_responses.go +++ b/rest_management_api_client/authenticator/detail_authenticator_responses.go @@ -65,7 +65,6 @@ func (o *DetailAuthenticatorReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewDetailAuthenticatorOK() *DetailAuthenticatorOK { return &DetailAuthenticatorOK{} } -/*DetailAuthenticatorOK handles this case with default header values. +/* DetailAuthenticatorOK describes a response with status code 200, with default header values. A singular authenticator resource */ @@ -87,7 +86,6 @@ type DetailAuthenticatorOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailAuthenticatorUnauthorized() *DetailAuthenticatorUnauthorized { return &DetailAuthenticatorUnauthorized{} } -/*DetailAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailAuthenticatorUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailAuthenticatorNotFound() *DetailAuthenticatorNotFound { return &DetailAuthenticatorNotFound{} } -/*DetailAuthenticatorNotFound handles this case with default header values. +/* DetailAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailAuthenticatorNotFound struct { 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 } diff --git a/rest_client/authenticator/list_authenticators_parameters.go b/rest_management_api_client/authenticator/list_authenticators_parameters.go similarity index 77% rename from rest_client/authenticator/list_authenticators_parameters.go rename to rest_management_api_client/authenticator/list_authenticators_parameters.go index fba785e29..8dd7ddc11 100644 --- a/rest_client/authenticator/list_authenticators_parameters.go +++ b/rest_management_api_client/authenticator/list_authenticators_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListAuthenticatorsParams creates a new ListAuthenticatorsParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 { timeout time.Duration @@ -88,6 +87,21 @@ type ListAuthenticatorsParams struct { 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) diff --git a/rest_client/authenticator/list_authenticators_responses.go b/rest_management_api_client/authenticator/list_authenticators_responses.go similarity index 96% rename from rest_client/authenticator/list_authenticators_responses.go rename to rest_management_api_client/authenticator/list_authenticators_responses.go index 90a4de56f..2d4cb0f4f 100644 --- a/rest_client/authenticator/list_authenticators_responses.go +++ b/rest_management_api_client/authenticator/list_authenticators_responses.go @@ -53,7 +53,6 @@ func (o *ListAuthenticatorsReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -64,7 +63,7 @@ func NewListAuthenticatorsOK() *ListAuthenticatorsOK { return &ListAuthenticatorsOK{} } -/*ListAuthenticatorsOK handles this case with default header values. +/* ListAuthenticatorsOK describes a response with status code 200, with default header values. A list of authenticators */ @@ -75,7 +74,6 @@ type ListAuthenticatorsOK struct { 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 } diff --git a/rest_client/authenticator/patch_authenticator_parameters.go b/rest_management_api_client/authenticator/patch_authenticator_parameters.go similarity index 80% rename from rest_client/authenticator/patch_authenticator_parameters.go rename to rest_management_api_client/authenticator/patch_authenticator_parameters.go index df2145c0c..357e147dd 100644 --- a/rest_client/authenticator/patch_authenticator_parameters.go +++ b/rest_management_api_client/authenticator/patch_authenticator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchAuthenticatorParams creates a new PatchAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &PatchAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewPatchAuthenticatorParamsWithTimeout creates a new PatchAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchAuthenticatorParamsWithTimeout(timeout time.Duration) *PatchAuthenticatorParams { - var () return &PatchAuthenticatorParams{ - timeout: timeout, } } // NewPatchAuthenticatorParamsWithContext creates a new PatchAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchAuthenticatorParamsWithContext(ctx context.Context) *PatchAuthenticatorParams { - var () return &PatchAuthenticatorParams{ - Context: ctx, } } // NewPatchAuthenticatorParamsWithHTTPClient creates a new PatchAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchAuthenticatorParamsWithHTTPClient(client *http.Client) *PatchAuthenticatorParams { - var () 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 +/* 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. + An authenticator patch object */ Authenticator *rest_model.AuthenticatorPatch - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchAuthenticatorParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Authenticator != nil { if err := r.SetBodyParam(o.Authenticator); err != nil { return err diff --git a/rest_client/authenticator/patch_authenticator_responses.go b/rest_management_api_client/authenticator/patch_authenticator_responses.go similarity index 94% rename from rest_client/authenticator/patch_authenticator_responses.go rename to rest_management_api_client/authenticator/patch_authenticator_responses.go index 4c1d06a2e..a484ddc8e 100644 --- a/rest_client/authenticator/patch_authenticator_responses.go +++ b/rest_management_api_client/authenticator/patch_authenticator_responses.go @@ -71,7 +71,6 @@ func (o *PatchAuthenticatorReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -82,7 +81,7 @@ func NewPatchAuthenticatorOK() *PatchAuthenticatorOK { return &PatchAuthenticatorOK{} } -/*PatchAuthenticatorOK handles this case with default header values. +/* PatchAuthenticatorOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchAuthenticatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchAuthenticatorBadRequest() *PatchAuthenticatorBadRequest { return &PatchAuthenticatorBadRequest{} } -/*PatchAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchAuthenticatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchAuthenticatorUnauthorized() *PatchAuthenticatorUnauthorized { return &PatchAuthenticatorUnauthorized{} } -/*PatchAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchAuthenticatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchAuthenticatorNotFound() *PatchAuthenticatorNotFound { return &PatchAuthenticatorNotFound{} } -/*PatchAuthenticatorNotFound handles this case with default header values. +/* PatchAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchAuthenticatorNotFound struct { 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 } diff --git a/rest_client/authenticator/update_authenticator_parameters.go b/rest_management_api_client/authenticator/update_authenticator_parameters.go similarity index 80% rename from rest_client/authenticator/update_authenticator_parameters.go rename to rest_management_api_client/authenticator/update_authenticator_parameters.go index b21628901..20655cd26 100644 --- a/rest_client/authenticator/update_authenticator_parameters.go +++ b/rest_management_api_client/authenticator/update_authenticator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateAuthenticatorParams creates a new UpdateAuthenticatorParams object -// with the default values initialized. +// 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 { - var () return &UpdateAuthenticatorParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAuthenticatorParamsWithTimeout creates a new UpdateAuthenticatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAuthenticatorParamsWithTimeout(timeout time.Duration) *UpdateAuthenticatorParams { - var () return &UpdateAuthenticatorParams{ - timeout: timeout, } } // NewUpdateAuthenticatorParamsWithContext creates a new UpdateAuthenticatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAuthenticatorParamsWithContext(ctx context.Context) *UpdateAuthenticatorParams { - var () return &UpdateAuthenticatorParams{ - Context: ctx, } } // NewUpdateAuthenticatorParamsWithHTTPClient creates a new UpdateAuthenticatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAuthenticatorParamsWithHTTPClient(client *http.Client) *UpdateAuthenticatorParams { - var () 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 +/* 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. + An authenticator put object */ Authenticator *rest_model.AuthenticatorUpdate - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateAuthenticatorParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Authenticator != nil { if err := r.SetBodyParam(o.Authenticator); err != nil { return err diff --git a/rest_client/authenticator/update_authenticator_responses.go b/rest_management_api_client/authenticator/update_authenticator_responses.go similarity index 94% rename from rest_client/authenticator/update_authenticator_responses.go rename to rest_management_api_client/authenticator/update_authenticator_responses.go index d3535fb9d..218d1f9e9 100644 --- a/rest_client/authenticator/update_authenticator_responses.go +++ b/rest_management_api_client/authenticator/update_authenticator_responses.go @@ -71,7 +71,6 @@ func (o *UpdateAuthenticatorReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -82,7 +81,7 @@ func NewUpdateAuthenticatorOK() *UpdateAuthenticatorOK { return &UpdateAuthenticatorOK{} } -/*UpdateAuthenticatorOK handles this case with default header values. +/* UpdateAuthenticatorOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateAuthenticatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateAuthenticatorBadRequest() *UpdateAuthenticatorBadRequest { return &UpdateAuthenticatorBadRequest{} } -/*UpdateAuthenticatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateAuthenticatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateAuthenticatorUnauthorized() *UpdateAuthenticatorUnauthorized { return &UpdateAuthenticatorUnauthorized{} } -/*UpdateAuthenticatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateAuthenticatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateAuthenticatorNotFound() *UpdateAuthenticatorNotFound { return &UpdateAuthenticatorNotFound{} } -/*UpdateAuthenticatorNotFound handles this case with default header values. +/* UpdateAuthenticatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateAuthenticatorNotFound struct { 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 } diff --git a/rest_client/certificate_authority/certificate_authority_client.go b/rest_management_api_client/certificate_authority/certificate_authority_client.go similarity index 85% rename from rest_client/certificate_authority/certificate_authority_client.go rename to rest_management_api_client/certificate_authority/certificate_authority_client.go index a32f86981..e64ed96fc 100644 --- a/rest_client/certificate_authority/certificate_authority_client.go +++ b/rest_management_api_client/certificate_authority/certificate_authority_client.go @@ -49,23 +49,26 @@ type Client struct { 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) (*CreateCaCreated, error) + CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCaCreated, error) - DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCaOK, error) + DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCaOK, error) - DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCaOK, error) + DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCaOK, error) - GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInfoWriter) (*GetCaJwtOK, error) + GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCaJwtOK, error) - ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter) (*ListCasOK, error) + ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCasOK, error) - PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCaOK, error) + PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCaOK, error) - UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCaOK, error) + UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCaOK, error) - VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter) (*VerifyCaOK, error) + VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyCaOK, error) SetTransport(transport runtime.ClientTransport) } @@ -75,13 +78,12 @@ type ClientService interface { Creates a CA in an unverified state. Requires admin access. */ -func (a *Client) CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInfoWriter) (*CreateCaCreated, error) { +func (a *Client) CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCaCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createCa", Method: "POST", PathPattern: "/cas", @@ -93,7 +95,12 @@ func (a *Client) CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInf 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 } @@ -114,13 +121,12 @@ func (a *Client) CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInf 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) (*DeleteCaOK, error) { +func (a *Client) DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteCa", Method: "DELETE", PathPattern: "/cas/{id}", @@ -132,7 +138,12 @@ func (a *Client) DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInf 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 } @@ -151,13 +162,12 @@ func (a *Client) DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInf Retrieves a single CA by id. Requires admin access. */ -func (a *Client) DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCaOK, error) { +func (a *Client) DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailCa", Method: "GET", PathPattern: "/cas/{id}", @@ -169,7 +179,12 @@ func (a *Client) DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInf 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 } @@ -190,13 +205,12 @@ func (a *Client) DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInf the jwt as a text response. */ -func (a *Client) GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInfoWriter) (*GetCaJwtOK, error) { +func (a *Client) GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCaJwtOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetCaJwtParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getCaJwt", Method: "GET", PathPattern: "/cas/{id}/jwt", @@ -208,7 +222,12 @@ func (a *Client) GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInf 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 } @@ -227,13 +246,12 @@ func (a *Client) GetCaJwt(params *GetCaJwtParams, authInfo runtime.ClientAuthInf Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter) (*ListCasOK, error) { +func (a *Client) ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCasOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListCasParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listCas", Method: "GET", PathPattern: "/cas", @@ -245,7 +263,12 @@ func (a *Client) ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoW 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 } @@ -264,13 +287,12 @@ func (a *Client) ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoW Update only the supplied fields on a CA by id. Requires admin access. */ -func (a *Client) PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCaOK, error) { +func (a *Client) PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchCa", Method: "PATCH", PathPattern: "/cas/{id}", @@ -282,7 +304,12 @@ func (a *Client) PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoW 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 } @@ -301,13 +328,12 @@ func (a *Client) PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoW Update all fields on a CA by id. Requires admin access. */ -func (a *Client) UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCaOK, error) { +func (a *Client) UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateCa", Method: "PUT", PathPattern: "/cas/{id}", @@ -319,7 +345,12 @@ func (a *Client) UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInf 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 } @@ -341,13 +372,12 @@ The common name on the certificate must match the verificationToken property of be used for enrollment/authentication. Requires admin access. */ -func (a *Client) VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter) (*VerifyCaOK, error) { +func (a *Client) VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyCaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVerifyCaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "verifyCa", Method: "POST", PathPattern: "/cas/{id}/verify", @@ -359,7 +389,12 @@ func (a *Client) VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInf 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 } diff --git a/rest_client/certificate_authority/create_ca_parameters.go b/rest_management_api_client/certificate_authority/create_ca_parameters.go similarity index 77% rename from rest_client/certificate_authority/create_ca_parameters.go rename to rest_management_api_client/certificate_authority/create_ca_parameters.go index 780462d25..7581e9786 100644 --- a/rest_client/certificate_authority/create_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/create_ca_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateCaParams creates a new CreateCaParams object -// with the default values initialized. +// 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 { - var () return &CreateCaParams{ - timeout: cr.DefaultTimeout, } } // NewCreateCaParamsWithTimeout creates a new CreateCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateCaParamsWithTimeout(timeout time.Duration) *CreateCaParams { - var () return &CreateCaParams{ - timeout: timeout, } } // NewCreateCaParamsWithContext creates a new CreateCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateCaParamsWithContext(ctx context.Context) *CreateCaParams { - var () return &CreateCaParams{ - Context: ctx, } } // NewCreateCaParamsWithHTTPClient creates a new CreateCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateCaParamsWithHTTPClient(client *http.Client) *CreateCaParams { - var () 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 +/* 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. + A CA to create */ Ca *rest_model.CaCreate @@ -97,6 +96,21 @@ type CreateCaParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if o.Ca != nil { if err := r.SetBodyParam(o.Ca); err != nil { return err diff --git a/rest_client/certificate_authority/create_ca_responses.go b/rest_management_api_client/certificate_authority/create_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/create_ca_responses.go rename to rest_management_api_client/certificate_authority/create_ca_responses.go index b10f6b0e3..afafc8671 100644 --- a/rest_client/certificate_authority/create_ca_responses.go +++ b/rest_management_api_client/certificate_authority/create_ca_responses.go @@ -65,7 +65,6 @@ func (o *CreateCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewCreateCaCreated() *CreateCaCreated { return &CreateCaCreated{} } -/*CreateCaCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateCaCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateCaBadRequest() *CreateCaBadRequest { return &CreateCaBadRequest{} } -/*CreateCaBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateCaBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateCaUnauthorized() *CreateCaUnauthorized { return &CreateCaUnauthorized{} } -/*CreateCaUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateCaUnauthorized struct { 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 } diff --git a/rest_client/certificate_authority/delete_ca_parameters.go b/rest_management_api_client/certificate_authority/delete_ca_parameters.go similarity index 77% rename from rest_client/certificate_authority/delete_ca_parameters.go rename to rest_management_api_client/certificate_authority/delete_ca_parameters.go index c8ea80b58..0d647c784 100644 --- a/rest_client/certificate_authority/delete_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/delete_ca_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteCaParams creates a new DeleteCaParams object -// with the default values initialized. +// 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 { - var () return &DeleteCaParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteCaParamsWithTimeout creates a new DeleteCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteCaParamsWithTimeout(timeout time.Duration) *DeleteCaParams { - var () return &DeleteCaParams{ - timeout: timeout, } } // NewDeleteCaParamsWithContext creates a new DeleteCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteCaParamsWithContext(ctx context.Context) *DeleteCaParams { - var () return &DeleteCaParams{ - Context: ctx, } } // NewDeleteCaParamsWithHTTPClient creates a new DeleteCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteCaParamsWithHTTPClient(client *http.Client) *DeleteCaParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteCaParams struct { 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) diff --git a/rest_client/certificate_authority/delete_ca_responses.go b/rest_management_api_client/certificate_authority/delete_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/delete_ca_responses.go rename to rest_management_api_client/certificate_authority/delete_ca_responses.go index f7c06fb6a..d3aaf328c 100644 --- a/rest_client/certificate_authority/delete_ca_responses.go +++ b/rest_management_api_client/certificate_authority/delete_ca_responses.go @@ -65,7 +65,6 @@ func (o *DeleteCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewDeleteCaOK() *DeleteCaOK { return &DeleteCaOK{} } -/*DeleteCaOK handles this case with default header values. +/* DeleteCaOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeleteCaOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteCaBadRequest() *DeleteCaBadRequest { return &DeleteCaBadRequest{} } -/*DeleteCaBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteCaBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteCaUnauthorized() *DeleteCaUnauthorized { return &DeleteCaUnauthorized{} } -/*DeleteCaUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type DeleteCaUnauthorized struct { 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 } diff --git a/rest_client/certificate_authority/detail_ca_parameters.go b/rest_management_api_client/certificate_authority/detail_ca_parameters.go similarity index 77% rename from rest_client/certificate_authority/detail_ca_parameters.go rename to rest_management_api_client/certificate_authority/detail_ca_parameters.go index 6ef9b51fa..72316ce62 100644 --- a/rest_client/certificate_authority/detail_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/detail_ca_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailCaParams creates a new DetailCaParams object -// with the default values initialized. +// 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 { - var () return &DetailCaParams{ - timeout: cr.DefaultTimeout, } } // NewDetailCaParamsWithTimeout creates a new DetailCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailCaParamsWithTimeout(timeout time.Duration) *DetailCaParams { - var () return &DetailCaParams{ - timeout: timeout, } } // NewDetailCaParamsWithContext creates a new DetailCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailCaParamsWithContext(ctx context.Context) *DetailCaParams { - var () return &DetailCaParams{ - Context: ctx, } } // NewDetailCaParamsWithHTTPClient creates a new DetailCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailCaParamsWithHTTPClient(client *http.Client) *DetailCaParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailCaParams struct { 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) diff --git a/rest_client/certificate_authority/detail_ca_responses.go b/rest_management_api_client/certificate_authority/detail_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/detail_ca_responses.go rename to rest_management_api_client/certificate_authority/detail_ca_responses.go index 3c70faed6..c087bfe6c 100644 --- a/rest_client/certificate_authority/detail_ca_responses.go +++ b/rest_management_api_client/certificate_authority/detail_ca_responses.go @@ -65,7 +65,6 @@ func (o *DetailCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewDetailCaOK() *DetailCaOK { return &DetailCaOK{} } -/*DetailCaOK handles this case with default header values. +/* DetailCaOK describes a response with status code 200, with default header values. A singular Certificate Authority (CA) resource */ @@ -87,7 +86,6 @@ type DetailCaOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailCaUnauthorized() *DetailCaUnauthorized { return &DetailCaUnauthorized{} } -/*DetailCaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailCaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailCaNotFound() *DetailCaNotFound { return &DetailCaNotFound{} } -/*DetailCaNotFound handles this case with default header values. +/* DetailCaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailCaNotFound struct { 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 } diff --git a/rest_client/certificate_authority/get_ca_jwt_parameters.go b/rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go similarity index 77% rename from rest_client/certificate_authority/get_ca_jwt_parameters.go rename to rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go index 626bda4ae..6f9a53c60 100644 --- a/rest_client/certificate_authority/get_ca_jwt_parameters.go +++ b/rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetCaJwtParams creates a new GetCaJwtParams object -// with the default values initialized. +// 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 { - var () return &GetCaJwtParams{ - timeout: cr.DefaultTimeout, } } // NewGetCaJwtParamsWithTimeout creates a new GetCaJwtParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetCaJwtParamsWithTimeout(timeout time.Duration) *GetCaJwtParams { - var () return &GetCaJwtParams{ - timeout: timeout, } } // NewGetCaJwtParamsWithContext creates a new GetCaJwtParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetCaJwtParamsWithContext(ctx context.Context) *GetCaJwtParams { - var () return &GetCaJwtParams{ - Context: ctx, } } // NewGetCaJwtParamsWithHTTPClient creates a new GetCaJwtParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetCaJwtParamsWithHTTPClient(client *http.Client) *GetCaJwtParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type GetCaJwtParams struct { 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) diff --git a/rest_client/certificate_authority/get_ca_jwt_responses.go b/rest_management_api_client/certificate_authority/get_ca_jwt_responses.go similarity index 94% rename from rest_client/certificate_authority/get_ca_jwt_responses.go rename to rest_management_api_client/certificate_authority/get_ca_jwt_responses.go index d6f8a7e4f..c52f8fc60 100644 --- a/rest_client/certificate_authority/get_ca_jwt_responses.go +++ b/rest_management_api_client/certificate_authority/get_ca_jwt_responses.go @@ -65,7 +65,6 @@ func (o *GetCaJwtReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -76,7 +75,7 @@ func NewGetCaJwtOK() *GetCaJwtOK { return &GetCaJwtOK{} } -/*GetCaJwtOK handles this case with default header values. +/* GetCaJwtOK describes a response with status code 200, with default header values. The result is the JWT text to validate the CA */ @@ -87,7 +86,6 @@ type GetCaJwtOK struct { 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 } @@ -107,7 +105,7 @@ func NewGetCaJwtUnauthorized() *GetCaJwtUnauthorized { return &GetCaJwtUnauthorized{} } -/*GetCaJwtUnauthorized handles this case with default header values. +/* 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 */ @@ -118,7 +116,6 @@ type GetCaJwtUnauthorized struct { 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 } @@ -140,7 +137,7 @@ func NewGetCaJwtNotFound() *GetCaJwtNotFound { return &GetCaJwtNotFound{} } -/*GetCaJwtNotFound handles this case with default header values. +/* GetCaJwtNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -151,7 +148,6 @@ type GetCaJwtNotFound struct { 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 } diff --git a/rest_client/certificate_authority/list_cas_parameters.go b/rest_management_api_client/certificate_authority/list_cas_parameters.go similarity index 82% rename from rest_client/certificate_authority/list_cas_parameters.go rename to rest_management_api_client/certificate_authority/list_cas_parameters.go index 6106e73a9..bb6f5aaac 100644 --- a/rest_client/certificate_authority/list_cas_parameters.go +++ b/rest_management_api_client/certificate_authority/list_cas_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListCasParams creates a new ListCasParams object -// with the default values initialized. +// 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 { - var () return &ListCasParams{ - timeout: cr.DefaultTimeout, } } // NewListCasParamsWithTimeout creates a new ListCasParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListCasParamsWithTimeout(timeout time.Duration) *ListCasParams { - var () return &ListCasParams{ - timeout: timeout, } } // NewListCasParamsWithContext creates a new ListCasParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListCasParamsWithContext(ctx context.Context) *ListCasParams { - var () return &ListCasParams{ - Context: ctx, } } // NewListCasParamsWithHTTPClient creates a new ListCasParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListCasParamsWithHTTPClient(client *http.Client) *ListCasParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListCasParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListCasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis // 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 { diff --git a/rest_client/certificate_authority/list_cas_responses.go b/rest_management_api_client/certificate_authority/list_cas_responses.go similarity index 96% rename from rest_client/certificate_authority/list_cas_responses.go rename to rest_management_api_client/certificate_authority/list_cas_responses.go index c5d93f98b..579dd87e5 100644 --- a/rest_client/certificate_authority/list_cas_responses.go +++ b/rest_management_api_client/certificate_authority/list_cas_responses.go @@ -53,7 +53,6 @@ func (o *ListCasReader) ReadResponse(response runtime.ClientResponse, consumer r 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()) } @@ -64,7 +63,7 @@ func NewListCasOK() *ListCasOK { return &ListCasOK{} } -/*ListCasOK handles this case with default header values. +/* ListCasOK describes a response with status code 200, with default header values. A list of Certificate Authorities (CAs) */ @@ -75,7 +74,6 @@ type ListCasOK struct { 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 } diff --git a/rest_client/certificate_authority/patch_ca_parameters.go b/rest_management_api_client/certificate_authority/patch_ca_parameters.go similarity index 78% rename from rest_client/certificate_authority/patch_ca_parameters.go rename to rest_management_api_client/certificate_authority/patch_ca_parameters.go index 07318cfa6..3ae0e1bbe 100644 --- a/rest_client/certificate_authority/patch_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/patch_ca_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchCaParams creates a new PatchCaParams object -// with the default values initialized. +// 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 { - var () return &PatchCaParams{ - timeout: cr.DefaultTimeout, } } // NewPatchCaParamsWithTimeout creates a new PatchCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchCaParamsWithTimeout(timeout time.Duration) *PatchCaParams { - var () return &PatchCaParams{ - timeout: timeout, } } // NewPatchCaParamsWithContext creates a new PatchCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchCaParamsWithContext(ctx context.Context) *PatchCaParams { - var () return &PatchCaParams{ - Context: ctx, } } // NewPatchCaParamsWithHTTPClient creates a new PatchCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchCaParamsWithHTTPClient(client *http.Client) *PatchCaParams { - var () 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 +/* 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. + A CA patch object */ Ca *rest_model.CaPatch - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchCaParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error - if o.Ca != nil { if err := r.SetBodyParam(o.Ca); err != nil { return err diff --git a/rest_client/certificate_authority/patch_ca_responses.go b/rest_management_api_client/certificate_authority/patch_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/patch_ca_responses.go rename to rest_management_api_client/certificate_authority/patch_ca_responses.go index 2ee446768..dd6dcc4c6 100644 --- a/rest_client/certificate_authority/patch_ca_responses.go +++ b/rest_management_api_client/certificate_authority/patch_ca_responses.go @@ -71,7 +71,6 @@ func (o *PatchCaReader) ReadResponse(response runtime.ClientResponse, consumer r 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()) } @@ -82,7 +81,7 @@ func NewPatchCaOK() *PatchCaOK { return &PatchCaOK{} } -/*PatchCaOK handles this case with default header values. +/* PatchCaOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchCaOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchCaBadRequest() *PatchCaBadRequest { return &PatchCaBadRequest{} } -/*PatchCaBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchCaBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchCaUnauthorized() *PatchCaUnauthorized { return &PatchCaUnauthorized{} } -/*PatchCaUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchCaUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchCaNotFound() *PatchCaNotFound { return &PatchCaNotFound{} } -/*PatchCaNotFound handles this case with default header values. +/* PatchCaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchCaNotFound struct { 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 } diff --git a/rest_client/certificate_authority/update_ca_parameters.go b/rest_management_api_client/certificate_authority/update_ca_parameters.go similarity index 78% rename from rest_client/certificate_authority/update_ca_parameters.go rename to rest_management_api_client/certificate_authority/update_ca_parameters.go index c066e88bc..65c137807 100644 --- a/rest_client/certificate_authority/update_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/update_ca_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateCaParams creates a new UpdateCaParams object -// with the default values initialized. +// 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 { - var () return &UpdateCaParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateCaParamsWithTimeout creates a new UpdateCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateCaParamsWithTimeout(timeout time.Duration) *UpdateCaParams { - var () return &UpdateCaParams{ - timeout: timeout, } } // NewUpdateCaParamsWithContext creates a new UpdateCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateCaParamsWithContext(ctx context.Context) *UpdateCaParams { - var () return &UpdateCaParams{ - Context: ctx, } } // NewUpdateCaParamsWithHTTPClient creates a new UpdateCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateCaParamsWithHTTPClient(client *http.Client) *UpdateCaParams { - var () 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 +/* 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. + A CA update object */ Ca *rest_model.CaUpdate - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateCaParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if o.Ca != nil { if err := r.SetBodyParam(o.Ca); err != nil { return err diff --git a/rest_client/certificate_authority/update_ca_responses.go b/rest_management_api_client/certificate_authority/update_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/update_ca_responses.go rename to rest_management_api_client/certificate_authority/update_ca_responses.go index 5266daa48..1874fa143 100644 --- a/rest_client/certificate_authority/update_ca_responses.go +++ b/rest_management_api_client/certificate_authority/update_ca_responses.go @@ -71,7 +71,6 @@ func (o *UpdateCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -82,7 +81,7 @@ func NewUpdateCaOK() *UpdateCaOK { return &UpdateCaOK{} } -/*UpdateCaOK handles this case with default header values. +/* UpdateCaOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateCaOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateCaBadRequest() *UpdateCaBadRequest { return &UpdateCaBadRequest{} } -/*UpdateCaBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateCaBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateCaUnauthorized() *UpdateCaUnauthorized { return &UpdateCaUnauthorized{} } -/*UpdateCaUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateCaUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateCaNotFound() *UpdateCaNotFound { return &UpdateCaNotFound{} } -/*UpdateCaNotFound handles this case with default header values. +/* UpdateCaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateCaNotFound struct { 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 } diff --git a/rest_client/certificate_authority/verify_ca_parameters.go b/rest_management_api_client/certificate_authority/verify_ca_parameters.go similarity index 77% rename from rest_client/certificate_authority/verify_ca_parameters.go rename to rest_management_api_client/certificate_authority/verify_ca_parameters.go index 78206a378..8ae975808 100644 --- a/rest_client/certificate_authority/verify_ca_parameters.go +++ b/rest_management_api_client/certificate_authority/verify_ca_parameters.go @@ -40,58 +40,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewVerifyCaParams creates a new VerifyCaParams object -// with the default values initialized. +// 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 { - var () return &VerifyCaParams{ - timeout: cr.DefaultTimeout, } } // NewVerifyCaParamsWithTimeout creates a new VerifyCaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewVerifyCaParamsWithTimeout(timeout time.Duration) *VerifyCaParams { - var () return &VerifyCaParams{ - timeout: timeout, } } // NewVerifyCaParamsWithContext creates a new VerifyCaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewVerifyCaParamsWithContext(ctx context.Context) *VerifyCaParams { - var () return &VerifyCaParams{ - Context: ctx, } } // NewVerifyCaParamsWithHTTPClient creates a new VerifyCaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewVerifyCaParamsWithHTTPClient(client *http.Client) *VerifyCaParams { - var () 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 +/* 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. + 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. + + The id of the requested resource */ ID string @@ -100,6 +100,21 @@ type VerifyCaParams struct { 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) @@ -162,7 +177,6 @@ func (o *VerifyCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if err := r.SetBodyParam(o.Certificate); err != nil { return err } diff --git a/rest_client/certificate_authority/verify_ca_responses.go b/rest_management_api_client/certificate_authority/verify_ca_responses.go similarity index 94% rename from rest_client/certificate_authority/verify_ca_responses.go rename to rest_management_api_client/certificate_authority/verify_ca_responses.go index 6b1d24721..88ec8b307 100644 --- a/rest_client/certificate_authority/verify_ca_responses.go +++ b/rest_management_api_client/certificate_authority/verify_ca_responses.go @@ -71,7 +71,6 @@ func (o *VerifyCaReader) ReadResponse(response runtime.ClientResponse, consumer 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()) } @@ -82,7 +81,7 @@ func NewVerifyCaOK() *VerifyCaOK { return &VerifyCaOK{} } -/*VerifyCaOK handles this case with default header values. +/* VerifyCaOK describes a response with status code 200, with default header values. Base empty response */ @@ -93,7 +92,6 @@ type VerifyCaOK struct { 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 } @@ -115,7 +113,7 @@ func NewVerifyCaBadRequest() *VerifyCaBadRequest { return &VerifyCaBadRequest{} } -/*VerifyCaBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type VerifyCaBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewVerifyCaUnauthorized() *VerifyCaUnauthorized { return &VerifyCaUnauthorized{} } -/*VerifyCaUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type VerifyCaUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewVerifyCaNotFound() *VerifyCaNotFound { return &VerifyCaNotFound{} } -/*VerifyCaNotFound handles this case with default header values. +/* VerifyCaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type VerifyCaNotFound struct { 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 } diff --git a/rest_client/config/config_client.go b/rest_management_api_client/config/config_client.go similarity index 83% rename from rest_client/config/config_client.go rename to rest_management_api_client/config/config_client.go index 9d2ee4ac5..7d66bf691 100644 --- a/rest_client/config/config_client.go +++ b/rest_management_api_client/config/config_client.go @@ -49,33 +49,36 @@ type Client struct { 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) (*CreateConfigCreated, error) + CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error) - CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*CreateConfigTypeCreated, error) + CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error) - DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteConfigOK, error) + DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) - DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteConfigTypeOK, error) + DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error) - DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter) (*DetailConfigOK, error) + DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error) - DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailConfigTypeOK, error) + DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) - ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigTypesOK, error) + ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) - ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigsOK, error) + ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) - ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigsForConfigTypeOK, error) + ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error) - PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter) (*PatchConfigOK, error) + PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error) - PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*PatchConfigTypeOK, error) + PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error) - UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateConfigOK, error) + UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) - UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateConfigTypeOK, error) + UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error) SetTransport(transport runtime.ClientTransport) } @@ -85,13 +88,12 @@ type ClientService interface { Create a config resource. Requires admin access. */ -func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter) (*CreateConfigCreated, error) { +func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createConfig", Method: "POST", PathPattern: "/configs", @@ -103,7 +105,12 @@ func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.Clien 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 } @@ -120,13 +127,12 @@ func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.Clien /* CreateConfigType creates a config type requires admin access */ -func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*CreateConfigTypeCreated, error) { +func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createConfigType", Method: "POST", PathPattern: "/config-types", @@ -138,7 +144,12 @@ func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runti 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 } @@ -157,13 +168,12 @@ func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runti Delete a config by id. Requires admin access. */ -func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteConfigOK, error) { +func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteConfig", Method: "DELETE", PathPattern: "/configs/{id}", @@ -175,7 +185,12 @@ func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.Clien 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 } @@ -194,13 +209,12 @@ func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.Clien 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) (*DeleteConfigTypeOK, error) { +func (a *Client) DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteConfigType", Method: "DELETE", PathPattern: "/config-types/{id}", @@ -212,7 +226,12 @@ func (a *Client) DeleteConfigType(params *DeleteConfigTypeParams, authInfo runti 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 } @@ -231,13 +250,12 @@ func (a *Client) DeleteConfigType(params *DeleteConfigTypeParams, authInfo runti Retrieves a single config by id. Requires admin access. */ -func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter) (*DetailConfigOK, error) { +func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailConfig", Method: "GET", PathPattern: "/configs/{id}", @@ -249,7 +267,12 @@ func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.Clien 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 } @@ -268,13 +291,12 @@ func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.Clien Retrieves a single config-type by id. Requires admin access. */ -func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailConfigTypeOK, error) { +func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailConfigType", Method: "GET", PathPattern: "/config-types/{id}", @@ -286,7 +308,12 @@ func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runti 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 } @@ -306,13 +333,12 @@ func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runti Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigTypesOK, error) { +func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListConfigTypesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listConfigTypes", Method: "GET", PathPattern: "/config-types", @@ -324,7 +350,12 @@ func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime 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 } @@ -344,13 +375,12 @@ func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigsOK, error) { +func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListConfigsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listConfigs", Method: "GET", PathPattern: "/configs", @@ -362,7 +392,12 @@ func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientA 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 } @@ -381,13 +416,12 @@ func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientA Lists the configs associated to a config-type. Requires admin access. */ -func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*ListConfigsForConfigTypeOK, error) { +func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListConfigsForConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listConfigsForConfigType", Method: "GET", PathPattern: "/config-types/{id}/configs", @@ -399,7 +433,12 @@ func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams 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 } @@ -418,13 +457,12 @@ func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams Update the supplied fields on a config. Requires admin access. */ -func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter) (*PatchConfigOK, error) { +func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchConfig", Method: "PATCH", PathPattern: "/configs/{id}", @@ -436,7 +474,12 @@ func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientA 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 } @@ -455,13 +498,12 @@ func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientA Update the supplied fields on a config-type. Requires admin access. */ -func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*PatchConfigTypeOK, error) { +func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchConfigType", Method: "PATCH", PathPattern: "/config-types/{id}", @@ -473,7 +515,12 @@ func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime 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 } @@ -492,13 +539,12 @@ func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime Update all fields on a config by id. Requires admin access. */ -func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateConfigOK, error) { +func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateConfig", Method: "PUT", PathPattern: "/configs/{id}", @@ -510,7 +556,12 @@ func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.Clien 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 } @@ -529,13 +580,12 @@ func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.Clien Update all fields on a config-type by id. Requires admin access. */ -func (a *Client) UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateConfigTypeOK, error) { +func (a *Client) UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateConfigTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateConfigType", Method: "PUT", PathPattern: "/config-types/{id}", @@ -547,7 +597,12 @@ func (a *Client) UpdateConfigType(params *UpdateConfigTypeParams, authInfo runti 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 } diff --git a/rest_client/config/create_config_parameters.go b/rest_management_api_client/config/create_config_parameters.go similarity index 79% rename from rest_client/config/create_config_parameters.go rename to rest_management_api_client/config/create_config_parameters.go index d916aaf38..b21d6370e 100644 --- a/rest_client/config/create_config_parameters.go +++ b/rest_management_api_client/config/create_config_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateConfigParams creates a new CreateConfigParams object -// with the default values initialized. +// 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 { - var () return &CreateConfigParams{ - timeout: cr.DefaultTimeout, } } // NewCreateConfigParamsWithTimeout creates a new CreateConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateConfigParamsWithTimeout(timeout time.Duration) *CreateConfigParams { - var () return &CreateConfigParams{ - timeout: timeout, } } // NewCreateConfigParamsWithContext creates a new CreateConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateConfigParamsWithContext(ctx context.Context) *CreateConfigParams { - var () return &CreateConfigParams{ - Context: ctx, } } // NewCreateConfigParamsWithHTTPClient creates a new CreateConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateConfigParamsWithHTTPClient(client *http.Client) *CreateConfigParams { - var () 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 +/* 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. + A config to create */ Config *rest_model.ConfigCreate @@ -97,6 +96,21 @@ type CreateConfigParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if o.Config != nil { if err := r.SetBodyParam(o.Config); err != nil { return err diff --git a/rest_client/config/create_config_responses.go b/rest_management_api_client/config/create_config_responses.go similarity index 94% rename from rest_client/config/create_config_responses.go rename to rest_management_api_client/config/create_config_responses.go index dc48474a0..e540eff3d 100644 --- a/rest_client/config/create_config_responses.go +++ b/rest_management_api_client/config/create_config_responses.go @@ -65,7 +65,6 @@ func (o *CreateConfigReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -76,7 +75,7 @@ func NewCreateConfigCreated() *CreateConfigCreated { return &CreateConfigCreated{} } -/*CreateConfigCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateConfigCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateConfigBadRequest() *CreateConfigBadRequest { return &CreateConfigBadRequest{} } -/*CreateConfigBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateConfigBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateConfigUnauthorized() *CreateConfigUnauthorized { return &CreateConfigUnauthorized{} } -/*CreateConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateConfigUnauthorized struct { 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 } diff --git a/rest_client/config/create_config_type_parameters.go b/rest_management_api_client/config/create_config_type_parameters.go similarity index 79% rename from rest_client/config/create_config_type_parameters.go rename to rest_management_api_client/config/create_config_type_parameters.go index 3da5937eb..18ef9d747 100644 --- a/rest_client/config/create_config_type_parameters.go +++ b/rest_management_api_client/config/create_config_type_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateConfigTypeParams creates a new CreateConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &CreateConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewCreateConfigTypeParamsWithTimeout creates a new CreateConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateConfigTypeParamsWithTimeout(timeout time.Duration) *CreateConfigTypeParams { - var () return &CreateConfigTypeParams{ - timeout: timeout, } } // NewCreateConfigTypeParamsWithContext creates a new CreateConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateConfigTypeParamsWithContext(ctx context.Context) *CreateConfigTypeParams { - var () return &CreateConfigTypeParams{ - Context: ctx, } } // NewCreateConfigTypeParamsWithHTTPClient creates a new CreateConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateConfigTypeParamsWithHTTPClient(client *http.Client) *CreateConfigTypeParams { - var () 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 +/* 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. + A config-type to create */ ConfigType *rest_model.ConfigTypeCreate @@ -97,6 +96,21 @@ type CreateConfigTypeParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.ConfigType != nil { if err := r.SetBodyParam(o.ConfigType); err != nil { return err diff --git a/rest_client/config/create_config_type_responses.go b/rest_management_api_client/config/create_config_type_responses.go similarity index 94% rename from rest_client/config/create_config_type_responses.go rename to rest_management_api_client/config/create_config_type_responses.go index 2311d8fcf..3f9ec328e 100644 --- a/rest_client/config/create_config_type_responses.go +++ b/rest_management_api_client/config/create_config_type_responses.go @@ -65,7 +65,6 @@ func (o *CreateConfigTypeReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewCreateConfigTypeCreated() *CreateConfigTypeCreated { return &CreateConfigTypeCreated{} } -/*CreateConfigTypeCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateConfigTypeCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateConfigTypeBadRequest() *CreateConfigTypeBadRequest { return &CreateConfigTypeBadRequest{} } -/*CreateConfigTypeBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateConfigTypeBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateConfigTypeUnauthorized() *CreateConfigTypeUnauthorized { return &CreateConfigTypeUnauthorized{} } -/*CreateConfigTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateConfigTypeUnauthorized struct { 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 } diff --git a/rest_client/config/delete_config_parameters.go b/rest_management_api_client/config/delete_config_parameters.go similarity index 78% rename from rest_client/config/delete_config_parameters.go rename to rest_management_api_client/config/delete_config_parameters.go index a53db66e6..b9ad8fcd4 100644 --- a/rest_client/config/delete_config_parameters.go +++ b/rest_management_api_client/config/delete_config_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteConfigParams creates a new DeleteConfigParams object -// with the default values initialized. +// 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 { - var () return &DeleteConfigParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteConfigParamsWithTimeout creates a new DeleteConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteConfigParamsWithTimeout(timeout time.Duration) *DeleteConfigParams { - var () return &DeleteConfigParams{ - timeout: timeout, } } // NewDeleteConfigParamsWithContext creates a new DeleteConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteConfigParamsWithContext(ctx context.Context) *DeleteConfigParams { - var () return &DeleteConfigParams{ - Context: ctx, } } // NewDeleteConfigParamsWithHTTPClient creates a new DeleteConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteConfigParamsWithHTTPClient(client *http.Client) *DeleteConfigParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteConfigParams struct { 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) diff --git a/rest_client/config/delete_config_responses.go b/rest_management_api_client/config/delete_config_responses.go similarity index 94% rename from rest_client/config/delete_config_responses.go rename to rest_management_api_client/config/delete_config_responses.go index d6c46de7e..751cdc9c6 100644 --- a/rest_client/config/delete_config_responses.go +++ b/rest_management_api_client/config/delete_config_responses.go @@ -71,7 +71,6 @@ func (o *DeleteConfigReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -82,7 +81,7 @@ func NewDeleteConfigOK() *DeleteConfigOK { return &DeleteConfigOK{} } -/*DeleteConfigOK handles this case with default header values. +/* DeleteConfigOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteConfigOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteConfigBadRequest() *DeleteConfigBadRequest { return &DeleteConfigBadRequest{} } -/*DeleteConfigBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteConfigBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteConfigUnauthorized() *DeleteConfigUnauthorized { return &DeleteConfigUnauthorized{} } -/*DeleteConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteConfigUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteConfigConflict() *DeleteConfigConflict { return &DeleteConfigConflict{} } -/*DeleteConfigConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteConfigConflict struct { 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 } diff --git a/rest_client/config/delete_config_type_parameters.go b/rest_management_api_client/config/delete_config_type_parameters.go similarity index 78% rename from rest_client/config/delete_config_type_parameters.go rename to rest_management_api_client/config/delete_config_type_parameters.go index 605795910..82915977b 100644 --- a/rest_client/config/delete_config_type_parameters.go +++ b/rest_management_api_client/config/delete_config_type_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteConfigTypeParams creates a new DeleteConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &DeleteConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteConfigTypeParamsWithTimeout creates a new DeleteConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteConfigTypeParamsWithTimeout(timeout time.Duration) *DeleteConfigTypeParams { - var () return &DeleteConfigTypeParams{ - timeout: timeout, } } // NewDeleteConfigTypeParamsWithContext creates a new DeleteConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteConfigTypeParamsWithContext(ctx context.Context) *DeleteConfigTypeParams { - var () return &DeleteConfigTypeParams{ - Context: ctx, } } // NewDeleteConfigTypeParamsWithHTTPClient creates a new DeleteConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteConfigTypeParamsWithHTTPClient(client *http.Client) *DeleteConfigTypeParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteConfigTypeParams struct { 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) diff --git a/rest_client/config/delete_config_type_responses.go b/rest_management_api_client/config/delete_config_type_responses.go similarity index 94% rename from rest_client/config/delete_config_type_responses.go rename to rest_management_api_client/config/delete_config_type_responses.go index 2c94b8f4d..d93d93cbf 100644 --- a/rest_client/config/delete_config_type_responses.go +++ b/rest_management_api_client/config/delete_config_type_responses.go @@ -71,7 +71,6 @@ func (o *DeleteConfigTypeReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewDeleteConfigTypeOK() *DeleteConfigTypeOK { return &DeleteConfigTypeOK{} } -/*DeleteConfigTypeOK handles this case with default header values. +/* DeleteConfigTypeOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteConfigTypeOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteConfigTypeBadRequest() *DeleteConfigTypeBadRequest { return &DeleteConfigTypeBadRequest{} } -/*DeleteConfigTypeBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteConfigTypeBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteConfigTypeUnauthorized() *DeleteConfigTypeUnauthorized { return &DeleteConfigTypeUnauthorized{} } -/*DeleteConfigTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteConfigTypeUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteConfigTypeConflict() *DeleteConfigTypeConflict { return &DeleteConfigTypeConflict{} } -/*DeleteConfigTypeConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteConfigTypeConflict struct { 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 } diff --git a/rest_client/config/detail_config_parameters.go b/rest_management_api_client/config/detail_config_parameters.go similarity index 78% rename from rest_client/config/detail_config_parameters.go rename to rest_management_api_client/config/detail_config_parameters.go index d0686d52f..ba2398e18 100644 --- a/rest_client/config/detail_config_parameters.go +++ b/rest_management_api_client/config/detail_config_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailConfigParams creates a new DetailConfigParams object -// with the default values initialized. +// 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 { - var () return &DetailConfigParams{ - timeout: cr.DefaultTimeout, } } // NewDetailConfigParamsWithTimeout creates a new DetailConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailConfigParamsWithTimeout(timeout time.Duration) *DetailConfigParams { - var () return &DetailConfigParams{ - timeout: timeout, } } // NewDetailConfigParamsWithContext creates a new DetailConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailConfigParamsWithContext(ctx context.Context) *DetailConfigParams { - var () return &DetailConfigParams{ - Context: ctx, } } // NewDetailConfigParamsWithHTTPClient creates a new DetailConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailConfigParamsWithHTTPClient(client *http.Client) *DetailConfigParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailConfigParams struct { 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) diff --git a/rest_client/config/detail_config_responses.go b/rest_management_api_client/config/detail_config_responses.go similarity index 94% rename from rest_client/config/detail_config_responses.go rename to rest_management_api_client/config/detail_config_responses.go index 6af879cc7..1700669fe 100644 --- a/rest_client/config/detail_config_responses.go +++ b/rest_management_api_client/config/detail_config_responses.go @@ -65,7 +65,6 @@ func (o *DetailConfigReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -76,7 +75,7 @@ func NewDetailConfigOK() *DetailConfigOK { return &DetailConfigOK{} } -/*DetailConfigOK handles this case with default header values. +/* DetailConfigOK describes a response with status code 200, with default header values. A singular config resource */ @@ -87,7 +86,6 @@ type DetailConfigOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailConfigUnauthorized() *DetailConfigUnauthorized { return &DetailConfigUnauthorized{} } -/*DetailConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailConfigUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailConfigNotFound() *DetailConfigNotFound { return &DetailConfigNotFound{} } -/*DetailConfigNotFound handles this case with default header values. +/* DetailConfigNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailConfigNotFound struct { 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 } diff --git a/rest_client/config/detail_config_type_parameters.go b/rest_management_api_client/config/detail_config_type_parameters.go similarity index 78% rename from rest_client/config/detail_config_type_parameters.go rename to rest_management_api_client/config/detail_config_type_parameters.go index 81e2c6dd9..ee73e259b 100644 --- a/rest_client/config/detail_config_type_parameters.go +++ b/rest_management_api_client/config/detail_config_type_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailConfigTypeParams creates a new DetailConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &DetailConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewDetailConfigTypeParamsWithTimeout creates a new DetailConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailConfigTypeParamsWithTimeout(timeout time.Duration) *DetailConfigTypeParams { - var () return &DetailConfigTypeParams{ - timeout: timeout, } } // NewDetailConfigTypeParamsWithContext creates a new DetailConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailConfigTypeParamsWithContext(ctx context.Context) *DetailConfigTypeParams { - var () return &DetailConfigTypeParams{ - Context: ctx, } } // NewDetailConfigTypeParamsWithHTTPClient creates a new DetailConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailConfigTypeParamsWithHTTPClient(client *http.Client) *DetailConfigTypeParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailConfigTypeParams struct { 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) diff --git a/rest_client/config/detail_config_type_responses.go b/rest_management_api_client/config/detail_config_type_responses.go similarity index 94% rename from rest_client/config/detail_config_type_responses.go rename to rest_management_api_client/config/detail_config_type_responses.go index 8babd21bf..bf29bb736 100644 --- a/rest_client/config/detail_config_type_responses.go +++ b/rest_management_api_client/config/detail_config_type_responses.go @@ -65,7 +65,6 @@ func (o *DetailConfigTypeReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewDetailConfigTypeOK() *DetailConfigTypeOK { return &DetailConfigTypeOK{} } -/*DetailConfigTypeOK handles this case with default header values. +/* DetailConfigTypeOK describes a response with status code 200, with default header values. A singular config-type resource */ @@ -87,7 +86,6 @@ type DetailConfigTypeOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailConfigTypeUnauthorized() *DetailConfigTypeUnauthorized { return &DetailConfigTypeUnauthorized{} } -/*DetailConfigTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailConfigTypeUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailConfigTypeNotFound() *DetailConfigTypeNotFound { return &DetailConfigTypeNotFound{} } -/*DetailConfigTypeNotFound handles this case with default header values. +/* DetailConfigTypeNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailConfigTypeNotFound struct { 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 } diff --git a/rest_client/config/list_config_types_parameters.go b/rest_management_api_client/config/list_config_types_parameters.go similarity index 83% rename from rest_client/config/list_config_types_parameters.go rename to rest_management_api_client/config/list_config_types_parameters.go index 5176cff8a..294311642 100644 --- a/rest_client/config/list_config_types_parameters.go +++ b/rest_management_api_client/config/list_config_types_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListConfigTypesParams creates a new ListConfigTypesParams object -// with the default values initialized. +// 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 { - var () return &ListConfigTypesParams{ - timeout: cr.DefaultTimeout, } } // NewListConfigTypesParamsWithTimeout creates a new ListConfigTypesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListConfigTypesParamsWithTimeout(timeout time.Duration) *ListConfigTypesParams { - var () return &ListConfigTypesParams{ - timeout: timeout, } } // NewListConfigTypesParamsWithContext creates a new ListConfigTypesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListConfigTypesParamsWithContext(ctx context.Context) *ListConfigTypesParams { - var () return &ListConfigTypesParams{ - Context: ctx, } } // NewListConfigTypesParamsWithHTTPClient creates a new ListConfigTypesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListConfigTypesParamsWithHTTPClient(client *http.Client) *ListConfigTypesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListConfigTypesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListConfigTypesParams) WriteToRequest(r runtime.ClientRequest, reg strf // 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 { diff --git a/rest_client/config/list_config_types_responses.go b/rest_management_api_client/config/list_config_types_responses.go similarity index 96% rename from rest_client/config/list_config_types_responses.go rename to rest_management_api_client/config/list_config_types_responses.go index 629318d9d..51dd1fb27 100644 --- a/rest_client/config/list_config_types_responses.go +++ b/rest_management_api_client/config/list_config_types_responses.go @@ -53,7 +53,6 @@ func (o *ListConfigTypesReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -64,7 +63,7 @@ func NewListConfigTypesOK() *ListConfigTypesOK { return &ListConfigTypesOK{} } -/*ListConfigTypesOK handles this case with default header values. +/* ListConfigTypesOK describes a response with status code 200, with default header values. A list of config-types */ @@ -75,7 +74,6 @@ type ListConfigTypesOK struct { 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 } diff --git a/rest_client/config/list_configs_for_config_type_parameters.go b/rest_management_api_client/config/list_configs_for_config_type_parameters.go similarity index 78% rename from rest_client/config/list_configs_for_config_type_parameters.go rename to rest_management_api_client/config/list_configs_for_config_type_parameters.go index c94a9f5df..91b6ba9de 100644 --- a/rest_client/config/list_configs_for_config_type_parameters.go +++ b/rest_management_api_client/config/list_configs_for_config_type_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListConfigsForConfigTypeParams creates a new ListConfigsForConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &ListConfigsForConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewListConfigsForConfigTypeParamsWithTimeout creates a new ListConfigsForConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListConfigsForConfigTypeParamsWithTimeout(timeout time.Duration) *ListConfigsForConfigTypeParams { - var () return &ListConfigsForConfigTypeParams{ - timeout: timeout, } } // NewListConfigsForConfigTypeParamsWithContext creates a new ListConfigsForConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListConfigsForConfigTypeParamsWithContext(ctx context.Context) *ListConfigsForConfigTypeParams { - var () return &ListConfigsForConfigTypeParams{ - Context: ctx, } } // NewListConfigsForConfigTypeParamsWithHTTPClient creates a new ListConfigsForConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListConfigsForConfigTypeParamsWithHTTPClient(client *http.Client) *ListConfigsForConfigTypeParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListConfigsForConfigTypeParams struct { 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) diff --git a/rest_client/config/list_configs_for_config_type_responses.go b/rest_management_api_client/config/list_configs_for_config_type_responses.go similarity index 96% rename from rest_client/config/list_configs_for_config_type_responses.go rename to rest_management_api_client/config/list_configs_for_config_type_responses.go index 40346c899..d5644065a 100644 --- a/rest_client/config/list_configs_for_config_type_responses.go +++ b/rest_management_api_client/config/list_configs_for_config_type_responses.go @@ -53,7 +53,6 @@ func (o *ListConfigsForConfigTypeReader) ReadResponse(response runtime.ClientRes 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()) } @@ -64,7 +63,7 @@ func NewListConfigsForConfigTypeOK() *ListConfigsForConfigTypeOK { return &ListConfigsForConfigTypeOK{} } -/*ListConfigsForConfigTypeOK handles this case with default header values. +/* ListConfigsForConfigTypeOK describes a response with status code 200, with default header values. A list of configs */ @@ -75,7 +74,6 @@ type ListConfigsForConfigTypeOK struct { 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 } diff --git a/rest_client/config/list_configs_parameters.go b/rest_management_api_client/config/list_configs_parameters.go similarity index 82% rename from rest_client/config/list_configs_parameters.go rename to rest_management_api_client/config/list_configs_parameters.go index c2f514002..1d943c95e 100644 --- a/rest_client/config/list_configs_parameters.go +++ b/rest_management_api_client/config/list_configs_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListConfigsParams creates a new ListConfigsParams object -// with the default values initialized. +// 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 { - var () return &ListConfigsParams{ - timeout: cr.DefaultTimeout, } } // NewListConfigsParamsWithTimeout creates a new ListConfigsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListConfigsParamsWithTimeout(timeout time.Duration) *ListConfigsParams { - var () return &ListConfigsParams{ - timeout: timeout, } } // NewListConfigsParamsWithContext creates a new ListConfigsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListConfigsParamsWithContext(ctx context.Context) *ListConfigsParams { - var () return &ListConfigsParams{ - Context: ctx, } } // NewListConfigsParamsWithHTTPClient creates a new ListConfigsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListConfigsParamsWithHTTPClient(client *http.Client) *ListConfigsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListConfigsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R // 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 { diff --git a/rest_client/config/list_configs_responses.go b/rest_management_api_client/config/list_configs_responses.go similarity index 95% rename from rest_client/config/list_configs_responses.go rename to rest_management_api_client/config/list_configs_responses.go index 67a7ba469..c1b05c798 100644 --- a/rest_client/config/list_configs_responses.go +++ b/rest_management_api_client/config/list_configs_responses.go @@ -59,7 +59,6 @@ func (o *ListConfigsReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -70,7 +69,7 @@ func NewListConfigsOK() *ListConfigsOK { return &ListConfigsOK{} } -/*ListConfigsOK handles this case with default header values. +/* ListConfigsOK describes a response with status code 200, with default header values. A list of configs */ @@ -81,7 +80,6 @@ type ListConfigsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListConfigsUnauthorized() *ListConfigsUnauthorized { return &ListConfigsUnauthorized{} } -/*ListConfigsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListConfigsUnauthorized struct { 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 } diff --git a/rest_client/config/patch_config_parameters.go b/rest_management_api_client/config/patch_config_parameters.go similarity index 78% rename from rest_client/config/patch_config_parameters.go rename to rest_management_api_client/config/patch_config_parameters.go index 97588e60d..dfe8b91e8 100644 --- a/rest_client/config/patch_config_parameters.go +++ b/rest_management_api_client/config/patch_config_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchConfigParams creates a new PatchConfigParams object -// with the default values initialized. +// 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 { - var () return &PatchConfigParams{ - timeout: cr.DefaultTimeout, } } // NewPatchConfigParamsWithTimeout creates a new PatchConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchConfigParamsWithTimeout(timeout time.Duration) *PatchConfigParams { - var () return &PatchConfigParams{ - timeout: timeout, } } // NewPatchConfigParamsWithContext creates a new PatchConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchConfigParamsWithContext(ctx context.Context) *PatchConfigParams { - var () return &PatchConfigParams{ - Context: ctx, } } // NewPatchConfigParamsWithHTTPClient creates a new PatchConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchConfigParamsWithHTTPClient(client *http.Client) *PatchConfigParams { - var () 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 +/* 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. + A config patch object */ Config *rest_model.ConfigPatch - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchConfigParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if o.Config != nil { if err := r.SetBodyParam(o.Config); err != nil { return err diff --git a/rest_client/config/patch_config_responses.go b/rest_management_api_client/config/patch_config_responses.go similarity index 94% rename from rest_client/config/patch_config_responses.go rename to rest_management_api_client/config/patch_config_responses.go index 47ff90a38..00befd846 100644 --- a/rest_client/config/patch_config_responses.go +++ b/rest_management_api_client/config/patch_config_responses.go @@ -71,7 +71,6 @@ func (o *PatchConfigReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -82,7 +81,7 @@ func NewPatchConfigOK() *PatchConfigOK { return &PatchConfigOK{} } -/*PatchConfigOK handles this case with default header values. +/* PatchConfigOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchConfigOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchConfigBadRequest() *PatchConfigBadRequest { return &PatchConfigBadRequest{} } -/*PatchConfigBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchConfigBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchConfigUnauthorized() *PatchConfigUnauthorized { return &PatchConfigUnauthorized{} } -/*PatchConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchConfigUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchConfigNotFound() *PatchConfigNotFound { return &PatchConfigNotFound{} } -/*PatchConfigNotFound handles this case with default header values. +/* PatchConfigNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchConfigNotFound struct { 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 } diff --git a/rest_client/config/patch_config_type_parameters.go b/rest_management_api_client/config/patch_config_type_parameters.go similarity index 80% rename from rest_client/config/patch_config_type_parameters.go rename to rest_management_api_client/config/patch_config_type_parameters.go index 943e2d113..dcb2464c8 100644 --- a/rest_client/config/patch_config_type_parameters.go +++ b/rest_management_api_client/config/patch_config_type_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchConfigTypeParams creates a new PatchConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &PatchConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewPatchConfigTypeParamsWithTimeout creates a new PatchConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchConfigTypeParamsWithTimeout(timeout time.Duration) *PatchConfigTypeParams { - var () return &PatchConfigTypeParams{ - timeout: timeout, } } // NewPatchConfigTypeParamsWithContext creates a new PatchConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchConfigTypeParamsWithContext(ctx context.Context) *PatchConfigTypeParams { - var () return &PatchConfigTypeParams{ - Context: ctx, } } // NewPatchConfigTypeParamsWithHTTPClient creates a new PatchConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchConfigTypeParamsWithHTTPClient(client *http.Client) *PatchConfigTypeParams { - var () 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 +/* 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. + A config-type patch object */ ConfigType *rest_model.ConfigTypePatch - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchConfigTypeParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if o.ConfigType != nil { if err := r.SetBodyParam(o.ConfigType); err != nil { return err diff --git a/rest_client/config/patch_config_type_responses.go b/rest_management_api_client/config/patch_config_type_responses.go similarity index 94% rename from rest_client/config/patch_config_type_responses.go rename to rest_management_api_client/config/patch_config_type_responses.go index 28a871423..32835abe2 100644 --- a/rest_client/config/patch_config_type_responses.go +++ b/rest_management_api_client/config/patch_config_type_responses.go @@ -71,7 +71,6 @@ func (o *PatchConfigTypeReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -82,7 +81,7 @@ func NewPatchConfigTypeOK() *PatchConfigTypeOK { return &PatchConfigTypeOK{} } -/*PatchConfigTypeOK handles this case with default header values. +/* PatchConfigTypeOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchConfigTypeOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchConfigTypeBadRequest() *PatchConfigTypeBadRequest { return &PatchConfigTypeBadRequest{} } -/*PatchConfigTypeBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchConfigTypeBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchConfigTypeUnauthorized() *PatchConfigTypeUnauthorized { return &PatchConfigTypeUnauthorized{} } -/*PatchConfigTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchConfigTypeUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchConfigTypeNotFound() *PatchConfigTypeNotFound { return &PatchConfigTypeNotFound{} } -/*PatchConfigTypeNotFound handles this case with default header values. +/* PatchConfigTypeNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchConfigTypeNotFound struct { 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 } diff --git a/rest_client/config/update_config_parameters.go b/rest_management_api_client/config/update_config_parameters.go similarity index 79% rename from rest_client/config/update_config_parameters.go rename to rest_management_api_client/config/update_config_parameters.go index 338ef1a23..1d21328db 100644 --- a/rest_client/config/update_config_parameters.go +++ b/rest_management_api_client/config/update_config_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateConfigParams creates a new UpdateConfigParams object -// with the default values initialized. +// 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 { - var () return &UpdateConfigParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateConfigParamsWithTimeout creates a new UpdateConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateConfigParamsWithTimeout(timeout time.Duration) *UpdateConfigParams { - var () return &UpdateConfigParams{ - timeout: timeout, } } // NewUpdateConfigParamsWithContext creates a new UpdateConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateConfigParamsWithContext(ctx context.Context) *UpdateConfigParams { - var () return &UpdateConfigParams{ - Context: ctx, } } // NewUpdateConfigParamsWithHTTPClient creates a new UpdateConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateConfigParamsWithHTTPClient(client *http.Client) *UpdateConfigParams { - var () 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 +/* 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. + A config update object */ Config *rest_model.ConfigUpdate - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateConfigParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if o.Config != nil { if err := r.SetBodyParam(o.Config); err != nil { return err diff --git a/rest_client/config/update_config_responses.go b/rest_management_api_client/config/update_config_responses.go similarity index 94% rename from rest_client/config/update_config_responses.go rename to rest_management_api_client/config/update_config_responses.go index b34555a8c..71d8c93ef 100644 --- a/rest_client/config/update_config_responses.go +++ b/rest_management_api_client/config/update_config_responses.go @@ -71,7 +71,6 @@ func (o *UpdateConfigReader) ReadResponse(response runtime.ClientResponse, consu 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()) } @@ -82,7 +81,7 @@ func NewUpdateConfigOK() *UpdateConfigOK { return &UpdateConfigOK{} } -/*UpdateConfigOK handles this case with default header values. +/* UpdateConfigOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateConfigOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateConfigBadRequest() *UpdateConfigBadRequest { return &UpdateConfigBadRequest{} } -/*UpdateConfigBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateConfigBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateConfigUnauthorized() *UpdateConfigUnauthorized { return &UpdateConfigUnauthorized{} } -/*UpdateConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateConfigUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateConfigNotFound() *UpdateConfigNotFound { return &UpdateConfigNotFound{} } -/*UpdateConfigNotFound handles this case with default header values. +/* UpdateConfigNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateConfigNotFound struct { 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 } diff --git a/rest_client/config/update_config_type_parameters.go b/rest_management_api_client/config/update_config_type_parameters.go similarity index 80% rename from rest_client/config/update_config_type_parameters.go rename to rest_management_api_client/config/update_config_type_parameters.go index 43162be54..a3255a797 100644 --- a/rest_client/config/update_config_type_parameters.go +++ b/rest_management_api_client/config/update_config_type_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateConfigTypeParams creates a new UpdateConfigTypeParams object -// with the default values initialized. +// 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 { - var () return &UpdateConfigTypeParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateConfigTypeParamsWithTimeout creates a new UpdateConfigTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateConfigTypeParamsWithTimeout(timeout time.Duration) *UpdateConfigTypeParams { - var () return &UpdateConfigTypeParams{ - timeout: timeout, } } // NewUpdateConfigTypeParamsWithContext creates a new UpdateConfigTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateConfigTypeParamsWithContext(ctx context.Context) *UpdateConfigTypeParams { - var () return &UpdateConfigTypeParams{ - Context: ctx, } } // NewUpdateConfigTypeParamsWithHTTPClient creates a new UpdateConfigTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateConfigTypeParamsWithHTTPClient(client *http.Client) *UpdateConfigTypeParams { - var () 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 +/* 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. + A config-type update object */ ConfigType *rest_model.ConfigTypeUpdate - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateConfigTypeParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.ConfigType != nil { if err := r.SetBodyParam(o.ConfigType); err != nil { return err diff --git a/rest_client/config/update_config_type_responses.go b/rest_management_api_client/config/update_config_type_responses.go similarity index 94% rename from rest_client/config/update_config_type_responses.go rename to rest_management_api_client/config/update_config_type_responses.go index b3da806eb..8da1aa2f8 100644 --- a/rest_client/config/update_config_type_responses.go +++ b/rest_management_api_client/config/update_config_type_responses.go @@ -71,7 +71,6 @@ func (o *UpdateConfigTypeReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewUpdateConfigTypeOK() *UpdateConfigTypeOK { return &UpdateConfigTypeOK{} } -/*UpdateConfigTypeOK handles this case with default header values. +/* UpdateConfigTypeOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateConfigTypeOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateConfigTypeBadRequest() *UpdateConfigTypeBadRequest { return &UpdateConfigTypeBadRequest{} } -/*UpdateConfigTypeBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateConfigTypeBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateConfigTypeUnauthorized() *UpdateConfigTypeUnauthorized { return &UpdateConfigTypeUnauthorized{} } -/*UpdateConfigTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateConfigTypeUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateConfigTypeNotFound() *UpdateConfigTypeNotFound { return &UpdateConfigTypeNotFound{} } -/*UpdateConfigTypeNotFound handles this case with default header values. +/* UpdateConfigTypeNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateConfigTypeNotFound struct { 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 } 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 new file mode 100644 index 000000000..7e9794e52 --- /dev/null +++ b/rest_management_api_client/current_api_session/current_api_session_client.go @@ -0,0 +1,325 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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) + + 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) +} + +/* + 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 new file mode 100644 index 000000000..5c4951b9c --- /dev/null +++ b/rest_management_api_client/current_api_session/delete_current_api_session_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d9b7736ac --- /dev/null +++ b/rest_management_api_client/current_api_session/delete_current_api_session_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f2ff1d6a8 --- /dev/null +++ b/rest_management_api_client/current_api_session/detail_current_identity_authenticator_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..8e8aa1649 --- /dev/null +++ b/rest_management_api_client/current_api_session/detail_current_identity_authenticator_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/get_current_api_session_parameters.go b/rest_management_api_client/current_api_session/get_current_api_session_parameters.go new file mode 100644 index 000000000..8c05178d7 --- /dev/null +++ b/rest_management_api_client/current_api_session/get_current_api_session_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..935fef909 --- /dev/null +++ b/rest_management_api_client/current_api_session/get_current_api_session_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..2bd843b6d --- /dev/null +++ b/rest_management_api_client/current_api_session/list_current_identity_authenticators_parameters.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..94eb9573a --- /dev/null +++ b/rest_management_api_client/current_api_session/list_current_identity_authenticators_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 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 +} + +// 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 new file mode 100644 index 000000000..debe472c0 --- /dev/null +++ b/rest_management_api_client/current_api_session/patch_current_identity_authenticator_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6aff8c0bd --- /dev/null +++ b/rest_management_api_client/current_api_session/patch_current_identity_authenticator_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..7cd4d10ea --- /dev/null +++ b/rest_management_api_client/current_api_session/update_current_identity_authenticator_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..ec70db64d --- /dev/null +++ b/rest_management_api_client/current_api_session/update_current_identity_authenticator_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..873b02559 --- /dev/null +++ b/rest_management_api_client/current_identity/create_mfa_recovery_codes_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9479e708f --- /dev/null +++ b/rest_management_api_client/current_identity/create_mfa_recovery_codes_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..04c313e63 --- /dev/null +++ b/rest_management_api_client/current_identity/current_identity_client.go @@ -0,0 +1,414 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..61d6c3dce --- /dev/null +++ b/rest_management_api_client/current_identity/delete_mfa_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4b819f28f --- /dev/null +++ b/rest_management_api_client/current_identity/delete_mfa_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1129729c8 --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f6a932d9c --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_qr_code_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..3c643d6fe --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_qr_code_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..3775fbf49 --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_recovery_codes_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..5cb19835f --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_recovery_codes_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e72d18ce1 --- /dev/null +++ b/rest_management_api_client/current_identity/detail_mfa_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..45bdeb753 --- /dev/null +++ b/rest_management_api_client/current_identity/enroll_mfa_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d97c57c69 --- /dev/null +++ b/rest_management_api_client/current_identity/enroll_mfa_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..73149df3e --- /dev/null +++ b/rest_management_api_client/current_identity/get_current_identity_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..367b324c9 --- /dev/null +++ b/rest_management_api_client/current_identity/get_current_identity_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..dcc00d18e --- /dev/null +++ b/rest_management_api_client/current_identity/verify_mfa_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e812bd325 --- /dev/null +++ b/rest_management_api_client/current_identity/verify_mfa_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/database/check_data_integrity_parameters.go b/rest_management_api_client/database/check_data_integrity_parameters.go similarity index 77% rename from rest_client/database/check_data_integrity_parameters.go rename to rest_management_api_client/database/check_data_integrity_parameters.go index aab785132..0c69a6d94 100644 --- a/rest_client/database/check_data_integrity_parameters.go +++ b/rest_management_api_client/database/check_data_integrity_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCheckDataIntegrityParams creates a new CheckDataIntegrityParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type CheckDataIntegrityParams struct { 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) diff --git a/rest_client/database/check_data_integrity_responses.go b/rest_management_api_client/database/check_data_integrity_responses.go similarity index 94% rename from rest_client/database/check_data_integrity_responses.go rename to rest_management_api_client/database/check_data_integrity_responses.go index 9d76d5803..f34b927ec 100644 --- a/rest_client/database/check_data_integrity_responses.go +++ b/rest_management_api_client/database/check_data_integrity_responses.go @@ -65,7 +65,6 @@ func (o *CheckDataIntegrityReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewCheckDataIntegrityAccepted() *CheckDataIntegrityAccepted { return &CheckDataIntegrityAccepted{} } -/*CheckDataIntegrityAccepted handles this case with default header values. +/* CheckDataIntegrityAccepted describes a response with status code 202, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type CheckDataIntegrityAccepted struct { 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 } @@ -109,7 +107,7 @@ func NewCheckDataIntegrityUnauthorized() *CheckDataIntegrityUnauthorized { return &CheckDataIntegrityUnauthorized{} } -/*CheckDataIntegrityUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CheckDataIntegrityUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewCheckDataIntegrityTooManyRequests() *CheckDataIntegrityTooManyRequests { return &CheckDataIntegrityTooManyRequests{} } -/*CheckDataIntegrityTooManyRequests handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CheckDataIntegrityTooManyRequests struct { 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 } diff --git a/rest_client/database/create_database_snapshot_parameters.go b/rest_management_api_client/database/create_database_snapshot_parameters.go similarity index 77% rename from rest_client/database/create_database_snapshot_parameters.go rename to rest_management_api_client/database/create_database_snapshot_parameters.go index 2b03656e1..ad172b25c 100644 --- a/rest_client/database/create_database_snapshot_parameters.go +++ b/rest_management_api_client/database/create_database_snapshot_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreateDatabaseSnapshotParams creates a new CreateDatabaseSnapshotParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type CreateDatabaseSnapshotParams struct { 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) diff --git a/rest_client/database/create_database_snapshot_responses.go b/rest_management_api_client/database/create_database_snapshot_responses.go similarity index 94% rename from rest_client/database/create_database_snapshot_responses.go rename to rest_management_api_client/database/create_database_snapshot_responses.go index 7031fc90b..35cd0e158 100644 --- a/rest_client/database/create_database_snapshot_responses.go +++ b/rest_management_api_client/database/create_database_snapshot_responses.go @@ -65,7 +65,6 @@ func (o *CreateDatabaseSnapshotReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewCreateDatabaseSnapshotOK() *CreateDatabaseSnapshotOK { return &CreateDatabaseSnapshotOK{} } -/*CreateDatabaseSnapshotOK handles this case with default header values. +/* CreateDatabaseSnapshotOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type CreateDatabaseSnapshotOK struct { 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 } @@ -109,7 +107,7 @@ func NewCreateDatabaseSnapshotUnauthorized() *CreateDatabaseSnapshotUnauthorized return &CreateDatabaseSnapshotUnauthorized{} } -/*CreateDatabaseSnapshotUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateDatabaseSnapshotUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewCreateDatabaseSnapshotTooManyRequests() *CreateDatabaseSnapshotTooManyRe return &CreateDatabaseSnapshotTooManyRequests{} } -/*CreateDatabaseSnapshotTooManyRequests handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateDatabaseSnapshotTooManyRequests struct { 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 } diff --git a/rest_client/database/data_integrity_results_parameters.go b/rest_management_api_client/database/data_integrity_results_parameters.go similarity index 77% rename from rest_client/database/data_integrity_results_parameters.go rename to rest_management_api_client/database/data_integrity_results_parameters.go index 8452371c6..5ddf307f7 100644 --- a/rest_client/database/data_integrity_results_parameters.go +++ b/rest_management_api_client/database/data_integrity_results_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDataIntegrityResultsParams creates a new DataIntegrityResultsParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type DataIntegrityResultsParams struct { 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) diff --git a/rest_client/database/data_integrity_results_responses.go b/rest_management_api_client/database/data_integrity_results_responses.go similarity index 95% rename from rest_client/database/data_integrity_results_responses.go rename to rest_management_api_client/database/data_integrity_results_responses.go index 5e28bc6d8..1dfd2882a 100644 --- a/rest_client/database/data_integrity_results_responses.go +++ b/rest_management_api_client/database/data_integrity_results_responses.go @@ -59,7 +59,6 @@ func (o *DataIntegrityResultsReader) ReadResponse(response runtime.ClientRespons 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()) } @@ -70,7 +69,7 @@ func NewDataIntegrityResultsOK() *DataIntegrityResultsOK { return &DataIntegrityResultsOK{} } -/*DataIntegrityResultsOK handles this case with default header values. +/* DataIntegrityResultsOK describes a response with status code 200, with default header values. A list of data integrity issues found */ @@ -81,7 +80,6 @@ type DataIntegrityResultsOK struct { 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 } @@ -103,7 +101,7 @@ func NewDataIntegrityResultsUnauthorized() *DataIntegrityResultsUnauthorized { return &DataIntegrityResultsUnauthorized{} } -/*DataIntegrityResultsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type DataIntegrityResultsUnauthorized struct { 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 } diff --git a/rest_client/database/database_client.go b/rest_management_api_client/database/database_client.go similarity index 84% rename from rest_client/database/database_client.go rename to rest_management_api_client/database/database_client.go index 7987e09ba..be54d42c7 100644 --- a/rest_client/database/database_client.go +++ b/rest_management_api_client/database/database_client.go @@ -49,15 +49,18 @@ type Client struct { 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) (*CheckDataIntegrityAccepted, error) + CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckDataIntegrityAccepted, error) - CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDatabaseSnapshotOK, error) + CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDatabaseSnapshotOK, error) - DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter) (*DataIntegrityResultsOK, error) + DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DataIntegrityResultsOK, error) - FixDataIntegrity(params *FixDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter) (*FixDataIntegrityAccepted, error) + FixDataIntegrity(params *FixDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*FixDataIntegrityAccepted, error) SetTransport(transport runtime.ClientTransport) } @@ -67,13 +70,12 @@ type ClientService interface { 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) (*CheckDataIntegrityAccepted, error) { +func (a *Client) CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckDataIntegrityAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewCheckDataIntegrityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "checkDataIntegrity", Method: "POST", PathPattern: "/database/check-data-integrity", @@ -85,7 +87,12 @@ func (a *Client) CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo r 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 } @@ -104,13 +111,12 @@ func (a *Client) CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo r Create a new database snapshot. Requires admin access. */ -func (a *Client) CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDatabaseSnapshotOK, error) { +func (a *Client) CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDatabaseSnapshotOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateDatabaseSnapshotParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createDatabaseSnapshot", Method: "POST", PathPattern: "/database/snapshot", @@ -122,7 +128,12 @@ func (a *Client) CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, au 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 } @@ -141,13 +152,12 @@ func (a *Client) CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, au Returns any results found from in-progress integrity checks. Requires admin access. */ -func (a *Client) DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter) (*DataIntegrityResultsOK, error) { +func (a *Client) DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DataIntegrityResultsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDataIntegrityResultsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "dataIntegrityResults", Method: "GET", PathPattern: "/database/data-integrity-results", @@ -159,7 +169,12 @@ func (a *Client) DataIntegrityResults(params *DataIntegrityResultsParams, authIn 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 } @@ -178,13 +193,12 @@ func (a *Client) DataIntegrityResults(params *DataIntegrityResultsParams, authIn 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) (*FixDataIntegrityAccepted, error) { +func (a *Client) FixDataIntegrity(params *FixDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*FixDataIntegrityAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewFixDataIntegrityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "fixDataIntegrity", Method: "POST", PathPattern: "/database/fix-data-integrity", @@ -196,7 +210,12 @@ func (a *Client) FixDataIntegrity(params *FixDataIntegrityParams, authInfo runti 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 } diff --git a/rest_client/database/fix_data_integrity_parameters.go b/rest_management_api_client/database/fix_data_integrity_parameters.go similarity index 77% rename from rest_client/database/fix_data_integrity_parameters.go rename to rest_management_api_client/database/fix_data_integrity_parameters.go index 0b415ac3e..6aca82cfc 100644 --- a/rest_client/database/fix_data_integrity_parameters.go +++ b/rest_management_api_client/database/fix_data_integrity_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewFixDataIntegrityParams creates a new FixDataIntegrityParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type FixDataIntegrityParams struct { 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) diff --git a/rest_client/database/fix_data_integrity_responses.go b/rest_management_api_client/database/fix_data_integrity_responses.go similarity index 94% rename from rest_client/database/fix_data_integrity_responses.go rename to rest_management_api_client/database/fix_data_integrity_responses.go index 052f1c07f..42475d218 100644 --- a/rest_client/database/fix_data_integrity_responses.go +++ b/rest_management_api_client/database/fix_data_integrity_responses.go @@ -65,7 +65,6 @@ func (o *FixDataIntegrityReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewFixDataIntegrityAccepted() *FixDataIntegrityAccepted { return &FixDataIntegrityAccepted{} } -/*FixDataIntegrityAccepted handles this case with default header values. +/* FixDataIntegrityAccepted describes a response with status code 202, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type FixDataIntegrityAccepted struct { 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 } @@ -109,7 +107,7 @@ func NewFixDataIntegrityUnauthorized() *FixDataIntegrityUnauthorized { return &FixDataIntegrityUnauthorized{} } -/*FixDataIntegrityUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type FixDataIntegrityUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewFixDataIntegrityTooManyRequests() *FixDataIntegrityTooManyRequests { return &FixDataIntegrityTooManyRequests{} } -/*FixDataIntegrityTooManyRequests handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type FixDataIntegrityTooManyRequests struct { 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 } diff --git a/rest_client/edge_router/create_edge_router_parameters.go b/rest_management_api_client/edge_router/create_edge_router_parameters.go similarity index 79% rename from rest_client/edge_router/create_edge_router_parameters.go rename to rest_management_api_client/edge_router/create_edge_router_parameters.go index a5e3fdb16..deeac5596 100644 --- a/rest_client/edge_router/create_edge_router_parameters.go +++ b/rest_management_api_client/edge_router/create_edge_router_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateEdgeRouterParams creates a new CreateEdgeRouterParams object -// with the default values initialized. +// 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 { - var () return &CreateEdgeRouterParams{ - timeout: cr.DefaultTimeout, } } // NewCreateEdgeRouterParamsWithTimeout creates a new CreateEdgeRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateEdgeRouterParamsWithTimeout(timeout time.Duration) *CreateEdgeRouterParams { - var () return &CreateEdgeRouterParams{ - timeout: timeout, } } // NewCreateEdgeRouterParamsWithContext creates a new CreateEdgeRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateEdgeRouterParamsWithContext(ctx context.Context) *CreateEdgeRouterParams { - var () return &CreateEdgeRouterParams{ - Context: ctx, } } // NewCreateEdgeRouterParamsWithHTTPClient creates a new CreateEdgeRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateEdgeRouterParamsWithHTTPClient(client *http.Client) *CreateEdgeRouterParams { - var () 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 +/* 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. + A edge router to create */ EdgeRouter *rest_model.EdgeRouterCreate @@ -97,6 +96,21 @@ type CreateEdgeRouterParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.EdgeRouter != nil { if err := r.SetBodyParam(o.EdgeRouter); err != nil { return err diff --git a/rest_client/edge_router/create_edge_router_responses.go b/rest_management_api_client/edge_router/create_edge_router_responses.go similarity index 94% rename from rest_client/edge_router/create_edge_router_responses.go rename to rest_management_api_client/edge_router/create_edge_router_responses.go index b247c9ca0..eccde3a22 100644 --- a/rest_client/edge_router/create_edge_router_responses.go +++ b/rest_management_api_client/edge_router/create_edge_router_responses.go @@ -65,7 +65,6 @@ func (o *CreateEdgeRouterReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewCreateEdgeRouterCreated() *CreateEdgeRouterCreated { return &CreateEdgeRouterCreated{} } -/*CreateEdgeRouterCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateEdgeRouterCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateEdgeRouterBadRequest() *CreateEdgeRouterBadRequest { return &CreateEdgeRouterBadRequest{} } -/*CreateEdgeRouterBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateEdgeRouterBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateEdgeRouterUnauthorized() *CreateEdgeRouterUnauthorized { return &CreateEdgeRouterUnauthorized{} } -/*CreateEdgeRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateEdgeRouterUnauthorized struct { 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 } diff --git a/rest_client/edge_router/delete_edge_router_parameters.go b/rest_management_api_client/edge_router/delete_edge_router_parameters.go similarity index 78% rename from rest_client/edge_router/delete_edge_router_parameters.go rename to rest_management_api_client/edge_router/delete_edge_router_parameters.go index 44bb14d58..30e5f7035 100644 --- a/rest_client/edge_router/delete_edge_router_parameters.go +++ b/rest_management_api_client/edge_router/delete_edge_router_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteEdgeRouterParams creates a new DeleteEdgeRouterParams object -// with the default values initialized. +// 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 { - var () return &DeleteEdgeRouterParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteEdgeRouterParamsWithTimeout creates a new DeleteEdgeRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteEdgeRouterParamsWithTimeout(timeout time.Duration) *DeleteEdgeRouterParams { - var () return &DeleteEdgeRouterParams{ - timeout: timeout, } } // NewDeleteEdgeRouterParamsWithContext creates a new DeleteEdgeRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteEdgeRouterParamsWithContext(ctx context.Context) *DeleteEdgeRouterParams { - var () return &DeleteEdgeRouterParams{ - Context: ctx, } } // NewDeleteEdgeRouterParamsWithHTTPClient creates a new DeleteEdgeRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteEdgeRouterParamsWithHTTPClient(client *http.Client) *DeleteEdgeRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteEdgeRouterParams struct { 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) diff --git a/rest_client/edge_router/delete_edge_router_responses.go b/rest_management_api_client/edge_router/delete_edge_router_responses.go similarity index 94% rename from rest_client/edge_router/delete_edge_router_responses.go rename to rest_management_api_client/edge_router/delete_edge_router_responses.go index f2f051d02..316ac392e 100644 --- a/rest_client/edge_router/delete_edge_router_responses.go +++ b/rest_management_api_client/edge_router/delete_edge_router_responses.go @@ -71,7 +71,6 @@ func (o *DeleteEdgeRouterReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewDeleteEdgeRouterOK() *DeleteEdgeRouterOK { return &DeleteEdgeRouterOK{} } -/*DeleteEdgeRouterOK handles this case with default header values. +/* DeleteEdgeRouterOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteEdgeRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteEdgeRouterBadRequest() *DeleteEdgeRouterBadRequest { return &DeleteEdgeRouterBadRequest{} } -/*DeleteEdgeRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteEdgeRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteEdgeRouterUnauthorized() *DeleteEdgeRouterUnauthorized { return &DeleteEdgeRouterUnauthorized{} } -/*DeleteEdgeRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteEdgeRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteEdgeRouterConflict() *DeleteEdgeRouterConflict { return &DeleteEdgeRouterConflict{} } -/*DeleteEdgeRouterConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteEdgeRouterConflict struct { 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 } diff --git a/rest_client/edge_router/detail_edge_router_parameters.go b/rest_management_api_client/edge_router/detail_edge_router_parameters.go similarity index 78% rename from rest_client/edge_router/detail_edge_router_parameters.go rename to rest_management_api_client/edge_router/detail_edge_router_parameters.go index 300d5e08b..1cfa7c5a5 100644 --- a/rest_client/edge_router/detail_edge_router_parameters.go +++ b/rest_management_api_client/edge_router/detail_edge_router_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailEdgeRouterParams creates a new DetailEdgeRouterParams object -// with the default values initialized. +// 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 { - var () return &DetailEdgeRouterParams{ - timeout: cr.DefaultTimeout, } } // NewDetailEdgeRouterParamsWithTimeout creates a new DetailEdgeRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailEdgeRouterParamsWithTimeout(timeout time.Duration) *DetailEdgeRouterParams { - var () return &DetailEdgeRouterParams{ - timeout: timeout, } } // NewDetailEdgeRouterParamsWithContext creates a new DetailEdgeRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailEdgeRouterParamsWithContext(ctx context.Context) *DetailEdgeRouterParams { - var () return &DetailEdgeRouterParams{ - Context: ctx, } } // NewDetailEdgeRouterParamsWithHTTPClient creates a new DetailEdgeRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailEdgeRouterParamsWithHTTPClient(client *http.Client) *DetailEdgeRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailEdgeRouterParams struct { 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) diff --git a/rest_client/edge_router/detail_edge_router_responses.go b/rest_management_api_client/edge_router/detail_edge_router_responses.go similarity index 94% rename from rest_client/edge_router/detail_edge_router_responses.go rename to rest_management_api_client/edge_router/detail_edge_router_responses.go index c9847e265..fc35aeda9 100644 --- a/rest_client/edge_router/detail_edge_router_responses.go +++ b/rest_management_api_client/edge_router/detail_edge_router_responses.go @@ -65,7 +65,6 @@ func (o *DetailEdgeRouterReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewDetailEdgeRouterOK() *DetailEdgeRouterOK { return &DetailEdgeRouterOK{} } -/*DetailEdgeRouterOK handles this case with default header values. +/* DetailEdgeRouterOK describes a response with status code 200, with default header values. A singular edge router resource */ @@ -87,7 +86,6 @@ type DetailEdgeRouterOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailEdgeRouterUnauthorized() *DetailEdgeRouterUnauthorized { return &DetailEdgeRouterUnauthorized{} } -/*DetailEdgeRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailEdgeRouterUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailEdgeRouterNotFound() *DetailEdgeRouterNotFound { return &DetailEdgeRouterNotFound{} } -/*DetailEdgeRouterNotFound handles this case with default header values. +/* DetailEdgeRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailEdgeRouterNotFound struct { 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 } diff --git a/rest_client/edge_router/edge_router_client.go b/rest_management_api_client/edge_router/edge_router_client.go similarity index 83% rename from rest_client/edge_router/edge_router_client.go rename to rest_management_api_client/edge_router/edge_router_client.go index 282fa476d..029cd45fb 100644 --- a/rest_client/edge_router/edge_router_client.go +++ b/rest_management_api_client/edge_router/edge_router_client.go @@ -49,27 +49,30 @@ type Client struct { 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) (*CreateEdgeRouterCreated, error) + CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error) - DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEdgeRouterOK, error) + DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error) - DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEdgeRouterOK, error) + DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error) - ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterEdgeRouterPoliciesOK, error) + ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error) - ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterIdentitiesOK, error) + ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error) - ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) + ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) - ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterServicesOK, error) + ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error) - ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRoutersOK, error) + ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error) - PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*PatchEdgeRouterOK, error) + PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error) - UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateEdgeRouterOK, error) + UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error) SetTransport(transport runtime.ClientTransport) } @@ -79,13 +82,12 @@ type ClientService interface { Create a edge router resource. Requires admin access. */ -func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*CreateEdgeRouterCreated, error) { +func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateEdgeRouterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createEdgeRouter", Method: "POST", PathPattern: "/edge-routers", @@ -97,7 +99,12 @@ func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runti 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 } @@ -116,13 +123,12 @@ func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runti Delete an edge router by id. Requires admin access. */ -func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEdgeRouterOK, error) { +func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteEdgeRouterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteEdgeRouter", Method: "DELETE", PathPattern: "/edge-routers/{id}", @@ -134,7 +140,12 @@ func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runti 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 } @@ -153,13 +164,12 @@ func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runti Retrieves a single edge router by id. Requires admin access. */ -func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEdgeRouterOK, error) { +func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailEdgeRouterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailEdgeRouter", Method: "GET", PathPattern: "/edge-routers/{id}", @@ -171,7 +181,12 @@ func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runti 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 } @@ -190,13 +205,12 @@ func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runti Retrieves a list of edge router policies that apply to the specified edge router. */ -func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterEdgeRouterPoliciesOK, error) { +func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterEdgeRouterPolicies", Method: "GET", PathPattern: "/edge-routers/{id}/edge-router-policies", @@ -208,7 +222,12 @@ func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRout 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 } @@ -228,13 +247,12 @@ func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRout 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) (*ListEdgeRouterIdentitiesOK, error) { +func (a *Client) ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterIdentitiesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterIdentities", Method: "GET", PathPattern: "/edge-routers/{id}/identities", @@ -246,7 +264,12 @@ func (a *Client) ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams 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 } @@ -265,13 +288,12 @@ func (a *Client) ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams Retrieves a list of service policies policies that apply to the specified edge router. */ -func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) { +func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterServiceEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterServiceEdgeRouterPolicies", Method: "GET", PathPattern: "/edge-routers/{id}/service-edge-router-policies", @@ -283,7 +305,12 @@ func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterS 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 } @@ -303,13 +330,12 @@ func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterS 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) (*ListEdgeRouterServicesOK, error) { +func (a *Client) ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterServices", Method: "GET", PathPattern: "/edge-routers/{id}/services", @@ -321,7 +347,12 @@ func (a *Client) ListEdgeRouterServices(params *ListEdgeRouterServicesParams, au 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 } @@ -341,13 +372,12 @@ func (a *Client) ListEdgeRouterServices(params *ListEdgeRouterServicesParams, au Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRoutersOK, error) { +func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouters", Method: "GET", PathPattern: "/edge-routers", @@ -359,7 +389,12 @@ func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime 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 } @@ -378,13 +413,12 @@ func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime Update the supplied fields on an edge router. Requires admin access. */ -func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*PatchEdgeRouterOK, error) { +func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchEdgeRouterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchEdgeRouter", Method: "PATCH", PathPattern: "/edge-routers/{id}", @@ -396,7 +430,12 @@ func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime 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 } @@ -415,13 +454,12 @@ func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime Update all fields on an edge router by id. Requires admin access. */ -func (a *Client) UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateEdgeRouterOK, error) { +func (a *Client) UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateEdgeRouterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateEdgeRouter", Method: "PUT", PathPattern: "/edge-routers/{id}", @@ -433,7 +471,12 @@ func (a *Client) UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runti 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/edge_router/list_edge_router_edge_router_policies_parameters.go rename to rest_management_api_client/edge_router/list_edge_router_edge_router_policies_parameters.go index 898b230d5..12c6a274a 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterEdgeRouterPoliciesParams creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterEdgeRouterPoliciesParams { - var () return &ListEdgeRouterEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListEdgeRouterEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterEdgeRouterPoliciesParams { - var () return &ListEdgeRouterEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListEdgeRouterEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterEdgeRouterPoliciesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterEdgeRouterPoliciesParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/edge_router/list_edge_router_edge_router_policies_responses.go rename to rest_management_api_client/edge_router/list_edge_router_edge_router_policies_responses.go index b7aa553ba..eefdd7b19 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListEdgeRouterEdgeRouterPoliciesReader) ReadResponse(response runtime.C 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterEdgeRouterPoliciesOK() *ListEdgeRouterEdgeRouterPoliciesOK return &ListEdgeRouterEdgeRouterPoliciesOK{} } -/*ListEdgeRouterEdgeRouterPoliciesOK handles this case with default header values. +/* ListEdgeRouterEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of edge router policies */ @@ -87,7 +86,6 @@ type ListEdgeRouterEdgeRouterPoliciesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterEdgeRouterPoliciesUnauthorized() *ListEdgeRouterEdgeRouter return &ListEdgeRouterEdgeRouterPoliciesUnauthorized{} } -/*ListEdgeRouterEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterEdgeRouterPoliciesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterEdgeRouterPoliciesNotFound() *ListEdgeRouterEdgeRouterPoli return &ListEdgeRouterEdgeRouterPoliciesNotFound{} } -/*ListEdgeRouterEdgeRouterPoliciesNotFound handles this case with default header values. +/* ListEdgeRouterEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterEdgeRouterPoliciesNotFound struct { 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 } diff --git a/rest_client/edge_router/list_edge_router_identities_parameters.go b/rest_management_api_client/edge_router/list_edge_router_identities_parameters.go similarity index 78% rename from rest_client/edge_router/list_edge_router_identities_parameters.go rename to rest_management_api_client/edge_router/list_edge_router_identities_parameters.go index 81df00933..cd1e5a9c2 100644 --- a/rest_client/edge_router/list_edge_router_identities_parameters.go +++ b/rest_management_api_client/edge_router/list_edge_router_identities_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterIdentitiesParams creates a new ListEdgeRouterIdentitiesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterIdentitiesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterIdentitiesParamsWithTimeout creates a new ListEdgeRouterIdentitiesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterIdentitiesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterIdentitiesParams { - var () return &ListEdgeRouterIdentitiesParams{ - timeout: timeout, } } // NewListEdgeRouterIdentitiesParamsWithContext creates a new ListEdgeRouterIdentitiesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterIdentitiesParamsWithContext(ctx context.Context) *ListEdgeRouterIdentitiesParams { - var () return &ListEdgeRouterIdentitiesParams{ - Context: ctx, } } // NewListEdgeRouterIdentitiesParamsWithHTTPClient creates a new ListEdgeRouterIdentitiesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterIdentitiesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterIdentitiesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterIdentitiesParams struct { 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) diff --git a/rest_client/edge_router/list_edge_router_identities_responses.go b/rest_management_api_client/edge_router/list_edge_router_identities_responses.go similarity index 94% rename from rest_client/edge_router/list_edge_router_identities_responses.go rename to rest_management_api_client/edge_router/list_edge_router_identities_responses.go index 1bf9b1c90..0736bbadb 100644 --- a/rest_client/edge_router/list_edge_router_identities_responses.go +++ b/rest_management_api_client/edge_router/list_edge_router_identities_responses.go @@ -65,7 +65,6 @@ func (o *ListEdgeRouterIdentitiesReader) ReadResponse(response runtime.ClientRes 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterIdentitiesOK() *ListEdgeRouterIdentitiesOK { return &ListEdgeRouterIdentitiesOK{} } -/*ListEdgeRouterIdentitiesOK handles this case with default header values. +/* ListEdgeRouterIdentitiesOK describes a response with status code 200, with default header values. A list of identities */ @@ -87,7 +86,6 @@ type ListEdgeRouterIdentitiesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterIdentitiesUnauthorized() *ListEdgeRouterIdentitiesUnauthor return &ListEdgeRouterIdentitiesUnauthorized{} } -/*ListEdgeRouterIdentitiesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterIdentitiesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterIdentitiesNotFound() *ListEdgeRouterIdentitiesNotFound { return &ListEdgeRouterIdentitiesNotFound{} } -/*ListEdgeRouterIdentitiesNotFound handles this case with default header values. +/* ListEdgeRouterIdentitiesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterIdentitiesNotFound struct { 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 } diff --git a/rest_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 similarity index 79% rename from rest_client/edge_router/list_edge_router_service_edge_router_policies_parameters.go rename to rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_parameters.go index dee952634..078e19853 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterServiceEdgeRouterPoliciesParams creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - var () return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - var () return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterServiceEdgeRouterPoliciesParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/edge_router/list_edge_router_service_edge_router_policies_responses.go rename to rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_responses.go index 6c733f0e8..9001e3b75 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListEdgeRouterServiceEdgeRouterPoliciesReader) ReadResponse(response ru 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterServiceEdgeRouterPoliciesOK() *ListEdgeRouterServiceEdgeRo return &ListEdgeRouterServiceEdgeRouterPoliciesOK{} } -/*ListEdgeRouterServiceEdgeRouterPoliciesOK handles this case with default header values. +/* ListEdgeRouterServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of service policies */ @@ -87,7 +86,6 @@ type ListEdgeRouterServiceEdgeRouterPoliciesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized() *ListEdgeRouterSer return &ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized{} } -/*ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterServiceEdgeRouterPoliciesNotFound() *ListEdgeRouterService return &ListEdgeRouterServiceEdgeRouterPoliciesNotFound{} } -/*ListEdgeRouterServiceEdgeRouterPoliciesNotFound handles this case with default header values. +/* ListEdgeRouterServiceEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterServiceEdgeRouterPoliciesNotFound struct { 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 } diff --git a/rest_client/edge_router/list_edge_router_services_parameters.go b/rest_management_api_client/edge_router/list_edge_router_services_parameters.go similarity index 78% rename from rest_client/edge_router/list_edge_router_services_parameters.go rename to rest_management_api_client/edge_router/list_edge_router_services_parameters.go index 1ed3973d1..2f29d39f9 100644 --- a/rest_client/edge_router/list_edge_router_services_parameters.go +++ b/rest_management_api_client/edge_router/list_edge_router_services_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterServicesParams creates a new ListEdgeRouterServicesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterServicesParamsWithTimeout creates a new ListEdgeRouterServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterServicesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterServicesParams { - var () return &ListEdgeRouterServicesParams{ - timeout: timeout, } } // NewListEdgeRouterServicesParamsWithContext creates a new ListEdgeRouterServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterServicesParamsWithContext(ctx context.Context) *ListEdgeRouterServicesParams { - var () return &ListEdgeRouterServicesParams{ - Context: ctx, } } // NewListEdgeRouterServicesParamsWithHTTPClient creates a new ListEdgeRouterServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterServicesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterServicesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterServicesParams struct { 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) diff --git a/rest_client/edge_router/list_edge_router_services_responses.go b/rest_management_api_client/edge_router/list_edge_router_services_responses.go similarity index 94% rename from rest_client/edge_router/list_edge_router_services_responses.go rename to rest_management_api_client/edge_router/list_edge_router_services_responses.go index 1c6118f72..5849f035d 100644 --- a/rest_client/edge_router/list_edge_router_services_responses.go +++ b/rest_management_api_client/edge_router/list_edge_router_services_responses.go @@ -65,7 +65,6 @@ func (o *ListEdgeRouterServicesReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterServicesOK() *ListEdgeRouterServicesOK { return &ListEdgeRouterServicesOK{} } -/*ListEdgeRouterServicesOK handles this case with default header values. +/* ListEdgeRouterServicesOK describes a response with status code 200, with default header values. A list of services */ @@ -87,7 +86,6 @@ type ListEdgeRouterServicesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterServicesUnauthorized() *ListEdgeRouterServicesUnauthorized return &ListEdgeRouterServicesUnauthorized{} } -/*ListEdgeRouterServicesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterServicesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterServicesNotFound() *ListEdgeRouterServicesNotFound { return &ListEdgeRouterServicesNotFound{} } -/*ListEdgeRouterServicesNotFound handles this case with default header values. +/* ListEdgeRouterServicesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterServicesNotFound struct { 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 } diff --git a/rest_client/edge_router/list_edge_routers_parameters.go b/rest_management_api_client/edge_router/list_edge_routers_parameters.go similarity index 77% rename from rest_client/edge_router/list_edge_routers_parameters.go rename to rest_management_api_client/edge_router/list_edge_routers_parameters.go index a90fb0b4f..8e62213e1 100644 --- a/rest_client/edge_router/list_edge_routers_parameters.go +++ b/rest_management_api_client/edge_router/list_edge_routers_parameters.go @@ -41,59 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListEdgeRoutersParams creates a new ListEdgeRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRoutersParamsWithTimeout creates a new ListEdgeRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListEdgeRoutersParams { - var () return &ListEdgeRoutersParams{ - timeout: timeout, } } // NewListEdgeRoutersParamsWithContext creates a new ListEdgeRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRoutersParamsWithContext(ctx context.Context) *ListEdgeRoutersParams { - var () return &ListEdgeRoutersParams{ - Context: ctx, } } // NewListEdgeRoutersParamsWithHTTPClient creates a new ListEdgeRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListEdgeRoutersParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 - /*RoleFilter*/ + + // RoleFilter. RoleFilter []string - /*RoleSemantic*/ + + // RoleSemantic. RoleSemantic *string timeout time.Duration @@ -101,6 +104,21 @@ type ListEdgeRoutersParams struct { 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) @@ -201,72 +219,79 @@ func (o *ListEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strf // 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 } } - } - valuesRoleFilter := o.RoleFilter + if o.RoleFilter != nil { - joinedRoleFilter := swag.JoinByFormat(valuesRoleFilter, "multi") - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err + // 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 { @@ -274,3 +299,20 @@ func (o *ListEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strf } 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_client/edge_router/list_edge_routers_responses.go b/rest_management_api_client/edge_router/list_edge_routers_responses.go similarity index 95% rename from rest_client/edge_router/list_edge_routers_responses.go rename to rest_management_api_client/edge_router/list_edge_routers_responses.go index 05b7be7da..a9b5e22c7 100644 --- a/rest_client/edge_router/list_edge_routers_responses.go +++ b/rest_management_api_client/edge_router/list_edge_routers_responses.go @@ -59,7 +59,6 @@ func (o *ListEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -70,7 +69,7 @@ func NewListEdgeRoutersOK() *ListEdgeRoutersOK { return &ListEdgeRoutersOK{} } -/*ListEdgeRoutersOK handles this case with default header values. +/* ListEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -81,7 +80,6 @@ type ListEdgeRoutersOK struct { 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 } @@ -103,7 +101,7 @@ func NewListEdgeRoutersUnauthorized() *ListEdgeRoutersUnauthorized { return &ListEdgeRoutersUnauthorized{} } -/*ListEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListEdgeRoutersUnauthorized struct { 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 } diff --git a/rest_client/edge_router/patch_edge_router_parameters.go b/rest_management_api_client/edge_router/patch_edge_router_parameters.go similarity index 80% rename from rest_client/edge_router/patch_edge_router_parameters.go rename to rest_management_api_client/edge_router/patch_edge_router_parameters.go index 0082a9134..1986ca709 100644 --- a/rest_client/edge_router/patch_edge_router_parameters.go +++ b/rest_management_api_client/edge_router/patch_edge_router_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchEdgeRouterParams creates a new PatchEdgeRouterParams object -// with the default values initialized. +// 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 { - var () return &PatchEdgeRouterParams{ - timeout: cr.DefaultTimeout, } } // NewPatchEdgeRouterParamsWithTimeout creates a new PatchEdgeRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchEdgeRouterParamsWithTimeout(timeout time.Duration) *PatchEdgeRouterParams { - var () return &PatchEdgeRouterParams{ - timeout: timeout, } } // NewPatchEdgeRouterParamsWithContext creates a new PatchEdgeRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchEdgeRouterParamsWithContext(ctx context.Context) *PatchEdgeRouterParams { - var () return &PatchEdgeRouterParams{ - Context: ctx, } } // NewPatchEdgeRouterParamsWithHTTPClient creates a new PatchEdgeRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchEdgeRouterParamsWithHTTPClient(client *http.Client) *PatchEdgeRouterParams { - var () 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 +/* 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. + An edge router patch object */ EdgeRouter *rest_model.EdgeRouterPatch - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type PatchEdgeRouterParams struct { 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) @@ -164,7 +179,6 @@ func (o *PatchEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if o.EdgeRouter != nil { if err := r.SetBodyParam(o.EdgeRouter); err != nil { return err diff --git a/rest_client/edge_router/patch_edge_router_responses.go b/rest_management_api_client/edge_router/patch_edge_router_responses.go similarity index 94% rename from rest_client/edge_router/patch_edge_router_responses.go rename to rest_management_api_client/edge_router/patch_edge_router_responses.go index f5930e9b1..148fec2de 100644 --- a/rest_client/edge_router/patch_edge_router_responses.go +++ b/rest_management_api_client/edge_router/patch_edge_router_responses.go @@ -71,7 +71,6 @@ func (o *PatchEdgeRouterReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -82,7 +81,7 @@ func NewPatchEdgeRouterOK() *PatchEdgeRouterOK { return &PatchEdgeRouterOK{} } -/*PatchEdgeRouterOK handles this case with default header values. +/* PatchEdgeRouterOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchEdgeRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchEdgeRouterBadRequest() *PatchEdgeRouterBadRequest { return &PatchEdgeRouterBadRequest{} } -/*PatchEdgeRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchEdgeRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchEdgeRouterUnauthorized() *PatchEdgeRouterUnauthorized { return &PatchEdgeRouterUnauthorized{} } -/*PatchEdgeRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchEdgeRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchEdgeRouterNotFound() *PatchEdgeRouterNotFound { return &PatchEdgeRouterNotFound{} } -/*PatchEdgeRouterNotFound handles this case with default header values. +/* PatchEdgeRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchEdgeRouterNotFound struct { 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 } diff --git a/rest_client/edge_router/update_edge_router_parameters.go b/rest_management_api_client/edge_router/update_edge_router_parameters.go similarity index 80% rename from rest_client/edge_router/update_edge_router_parameters.go rename to rest_management_api_client/edge_router/update_edge_router_parameters.go index 92615a3da..5a728c1c7 100644 --- a/rest_client/edge_router/update_edge_router_parameters.go +++ b/rest_management_api_client/edge_router/update_edge_router_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateEdgeRouterParams creates a new UpdateEdgeRouterParams object -// with the default values initialized. +// 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 { - var () return &UpdateEdgeRouterParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateEdgeRouterParamsWithTimeout creates a new UpdateEdgeRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateEdgeRouterParamsWithTimeout(timeout time.Duration) *UpdateEdgeRouterParams { - var () return &UpdateEdgeRouterParams{ - timeout: timeout, } } // NewUpdateEdgeRouterParamsWithContext creates a new UpdateEdgeRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateEdgeRouterParamsWithContext(ctx context.Context) *UpdateEdgeRouterParams { - var () return &UpdateEdgeRouterParams{ - Context: ctx, } } // NewUpdateEdgeRouterParamsWithHTTPClient creates a new UpdateEdgeRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateEdgeRouterParamsWithHTTPClient(client *http.Client) *UpdateEdgeRouterParams { - var () 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 +/* 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. + An edge router update object */ EdgeRouter *rest_model.EdgeRouterUpdate - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string @@ -102,6 +102,21 @@ type UpdateEdgeRouterParams struct { 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) @@ -164,7 +179,6 @@ func (o *UpdateEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.EdgeRouter != nil { if err := r.SetBodyParam(o.EdgeRouter); err != nil { return err diff --git a/rest_client/edge_router/update_edge_router_responses.go b/rest_management_api_client/edge_router/update_edge_router_responses.go similarity index 94% rename from rest_client/edge_router/update_edge_router_responses.go rename to rest_management_api_client/edge_router/update_edge_router_responses.go index 0f8b505ee..fc6f89d42 100644 --- a/rest_client/edge_router/update_edge_router_responses.go +++ b/rest_management_api_client/edge_router/update_edge_router_responses.go @@ -71,7 +71,6 @@ func (o *UpdateEdgeRouterReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewUpdateEdgeRouterOK() *UpdateEdgeRouterOK { return &UpdateEdgeRouterOK{} } -/*UpdateEdgeRouterOK handles this case with default header values. +/* UpdateEdgeRouterOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateEdgeRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateEdgeRouterBadRequest() *UpdateEdgeRouterBadRequest { return &UpdateEdgeRouterBadRequest{} } -/*UpdateEdgeRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateEdgeRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateEdgeRouterUnauthorized() *UpdateEdgeRouterUnauthorized { return &UpdateEdgeRouterUnauthorized{} } -/*UpdateEdgeRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateEdgeRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateEdgeRouterNotFound() *UpdateEdgeRouterNotFound { return &UpdateEdgeRouterNotFound{} } -/*UpdateEdgeRouterNotFound handles this case with default header values. +/* UpdateEdgeRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateEdgeRouterNotFound struct { 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 } diff --git a/rest_client/edge_router_policy/create_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go similarity index 79% rename from rest_client/edge_router_policy/create_edge_router_policy_parameters.go rename to rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go index 69106f729..6154a45aa 100644 --- a/rest_client/edge_router_policy/create_edge_router_policy_parameters.go +++ b/rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateEdgeRouterPolicyParams creates a new CreateEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &CreateEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewCreateEdgeRouterPolicyParamsWithTimeout creates a new CreateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *CreateEdgeRouterPolicyParams { - var () return &CreateEdgeRouterPolicyParams{ - timeout: timeout, } } // NewCreateEdgeRouterPolicyParamsWithContext creates a new CreateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateEdgeRouterPolicyParamsWithContext(ctx context.Context) *CreateEdgeRouterPolicyParams { - var () return &CreateEdgeRouterPolicyParams{ - Context: ctx, } } // NewCreateEdgeRouterPolicyParamsWithHTTPClient creates a new CreateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *CreateEdgeRouterPolicyParams { - var () 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 +/* 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. + An edge router policy to create */ Policy *rest_model.EdgeRouterPolicyCreate @@ -97,6 +96,21 @@ type CreateEdgeRouterPolicyParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Policy != nil { if err := r.SetBodyParam(o.Policy); err != nil { return err diff --git a/rest_client/edge_router_policy/create_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go similarity index 94% rename from rest_client/edge_router_policy/create_edge_router_policy_responses.go rename to rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go index d6bed7482..68384b72e 100644 --- a/rest_client/edge_router_policy/create_edge_router_policy_responses.go +++ b/rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go @@ -65,7 +65,6 @@ func (o *CreateEdgeRouterPolicyReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewCreateEdgeRouterPolicyCreated() *CreateEdgeRouterPolicyCreated { return &CreateEdgeRouterPolicyCreated{} } -/*CreateEdgeRouterPolicyCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateEdgeRouterPolicyCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateEdgeRouterPolicyBadRequest() *CreateEdgeRouterPolicyBadRequest { return &CreateEdgeRouterPolicyBadRequest{} } -/*CreateEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateEdgeRouterPolicyBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateEdgeRouterPolicyUnauthorized() *CreateEdgeRouterPolicyUnauthorized return &CreateEdgeRouterPolicyUnauthorized{} } -/*CreateEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateEdgeRouterPolicyUnauthorized struct { 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 } diff --git a/rest_client/edge_router_policy/delete_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go similarity index 78% rename from rest_client/edge_router_policy/delete_edge_router_policy_parameters.go rename to rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go index e0c739e62..67b845ac0 100644 --- a/rest_client/edge_router_policy/delete_edge_router_policy_parameters.go +++ b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteEdgeRouterPolicyParams creates a new DeleteEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &DeleteEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteEdgeRouterPolicyParamsWithTimeout creates a new DeleteEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DeleteEdgeRouterPolicyParams { - var () return &DeleteEdgeRouterPolicyParams{ - timeout: timeout, } } // NewDeleteEdgeRouterPolicyParamsWithContext creates a new DeleteEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteEdgeRouterPolicyParamsWithContext(ctx context.Context) *DeleteEdgeRouterPolicyParams { - var () return &DeleteEdgeRouterPolicyParams{ - Context: ctx, } } // NewDeleteEdgeRouterPolicyParamsWithHTTPClient creates a new DeleteEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DeleteEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteEdgeRouterPolicyParams struct { 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) diff --git a/rest_client/edge_router_policy/delete_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go similarity index 94% rename from rest_client/edge_router_policy/delete_edge_router_policy_responses.go rename to rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go index 5926ec134..f10b6ac6e 100644 --- a/rest_client/edge_router_policy/delete_edge_router_policy_responses.go +++ b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go @@ -71,7 +71,6 @@ func (o *DeleteEdgeRouterPolicyReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -82,7 +81,7 @@ func NewDeleteEdgeRouterPolicyOK() *DeleteEdgeRouterPolicyOK { return &DeleteEdgeRouterPolicyOK{} } -/*DeleteEdgeRouterPolicyOK handles this case with default header values. +/* DeleteEdgeRouterPolicyOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteEdgeRouterPolicyBadRequest() *DeleteEdgeRouterPolicyBadRequest { return &DeleteEdgeRouterPolicyBadRequest{} } -/*DeleteEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteEdgeRouterPolicyUnauthorized() *DeleteEdgeRouterPolicyUnauthorized return &DeleteEdgeRouterPolicyUnauthorized{} } -/*DeleteEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteEdgeRouterPolicyConflict() *DeleteEdgeRouterPolicyConflict { return &DeleteEdgeRouterPolicyConflict{} } -/*DeleteEdgeRouterPolicyConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteEdgeRouterPolicyConflict struct { 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 } diff --git a/rest_client/edge_router_policy/detail_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go similarity index 78% rename from rest_client/edge_router_policy/detail_edge_router_policy_parameters.go rename to rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go index 573a57e15..ac6fd6fdd 100644 --- a/rest_client/edge_router_policy/detail_edge_router_policy_parameters.go +++ b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailEdgeRouterPolicyParams creates a new DetailEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &DetailEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDetailEdgeRouterPolicyParamsWithTimeout creates a new DetailEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DetailEdgeRouterPolicyParams { - var () return &DetailEdgeRouterPolicyParams{ - timeout: timeout, } } // NewDetailEdgeRouterPolicyParamsWithContext creates a new DetailEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailEdgeRouterPolicyParamsWithContext(ctx context.Context) *DetailEdgeRouterPolicyParams { - var () return &DetailEdgeRouterPolicyParams{ - Context: ctx, } } // NewDetailEdgeRouterPolicyParamsWithHTTPClient creates a new DetailEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DetailEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailEdgeRouterPolicyParams struct { 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) diff --git a/rest_client/edge_router_policy/detail_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go similarity index 94% rename from rest_client/edge_router_policy/detail_edge_router_policy_responses.go rename to rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go index 4b7992fd0..1876d0392 100644 --- a/rest_client/edge_router_policy/detail_edge_router_policy_responses.go +++ b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go @@ -65,7 +65,6 @@ func (o *DetailEdgeRouterPolicyReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewDetailEdgeRouterPolicyOK() *DetailEdgeRouterPolicyOK { return &DetailEdgeRouterPolicyOK{} } -/*DetailEdgeRouterPolicyOK handles this case with default header values. +/* DetailEdgeRouterPolicyOK describes a response with status code 200, with default header values. A single edge router policy */ @@ -87,7 +86,6 @@ type DetailEdgeRouterPolicyOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailEdgeRouterPolicyUnauthorized() *DetailEdgeRouterPolicyUnauthorized return &DetailEdgeRouterPolicyUnauthorized{} } -/*DetailEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailEdgeRouterPolicyUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailEdgeRouterPolicyNotFound() *DetailEdgeRouterPolicyNotFound { return &DetailEdgeRouterPolicyNotFound{} } -/*DetailEdgeRouterPolicyNotFound handles this case with default header values. +/* DetailEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_client/edge_router_policy/edge_router_policy_client.go b/rest_management_api_client/edge_router_policy/edge_router_policy_client.go similarity index 83% rename from rest_client/edge_router_policy/edge_router_policy_client.go rename to rest_management_api_client/edge_router_policy/edge_router_policy_client.go index 80b7edb64..ec3692307 100644 --- a/rest_client/edge_router_policy/edge_router_policy_client.go +++ b/rest_management_api_client/edge_router_policy/edge_router_policy_client.go @@ -49,23 +49,26 @@ type Client struct { 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) (*CreateEdgeRouterPolicyCreated, error) + CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterPolicyCreated, error) - DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEdgeRouterPolicyOK, error) + DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterPolicyOK, error) - DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEdgeRouterPolicyOK, error) + DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterPolicyOK, error) - ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterPoliciesOK, error) + ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPoliciesOK, error) - ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterPolicyEdgeRoutersOK, error) + ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyEdgeRoutersOK, error) - ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListEdgeRouterPolicyIdentitiesOK, error) + ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyIdentitiesOK, error) - PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchEdgeRouterPolicyOK, error) + PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterPolicyOK, error) - UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateEdgeRouterPolicyOK, error) + UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterPolicyOK, error) SetTransport(transport runtime.ClientTransport) } @@ -75,13 +78,12 @@ type ClientService interface { Create an edge router policy resource. Requires admin access. */ -func (a *Client) CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateEdgeRouterPolicyCreated, error) { +func (a *Client) CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterPolicyCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createEdgeRouterPolicy", Method: "POST", PathPattern: "/edge-router-policies", @@ -93,7 +95,12 @@ func (a *Client) CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, au 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 } @@ -112,13 +119,12 @@ func (a *Client) CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, au Delete an edge router policy by id. Requires admin access. */ -func (a *Client) DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEdgeRouterPolicyOK, error) { +func (a *Client) DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteEdgeRouterPolicy", Method: "DELETE", PathPattern: "/edge-router-policies/{id}", @@ -130,7 +136,12 @@ func (a *Client) DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, au 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 } @@ -149,13 +160,12 @@ func (a *Client) DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, au Retrieves a single edge router policy by id. Requires admin access. */ -func (a *Client) DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEdgeRouterPolicyOK, error) { +func (a *Client) DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailEdgeRouterPolicy", Method: "GET", PathPattern: "/edge-router-policies/{id}", @@ -167,7 +177,12 @@ func (a *Client) DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, au 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 } @@ -187,13 +202,12 @@ func (a *Client) DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, au 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) (*ListEdgeRouterPoliciesOK, error) { +func (a *Client) ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterPolicies", Method: "GET", PathPattern: "/edge-router-policies", @@ -205,7 +219,12 @@ func (a *Client) ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, au 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 } @@ -225,13 +244,12 @@ func (a *Client) ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, au 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) (*ListEdgeRouterPolicyEdgeRoutersOK, error) { +func (a *Client) ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterPolicyEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterPolicyEdgeRouters", Method: "GET", PathPattern: "/edge-router-policies/{id}/edge-routers", @@ -243,7 +261,12 @@ func (a *Client) ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdg 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 } @@ -263,13 +286,12 @@ func (a *Client) ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdg 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) (*ListEdgeRouterPolicyIdentitiesOK, error) { +func (a *Client) ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterPolicyIdentitiesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterPolicyIdentities", Method: "GET", PathPattern: "/edge-router-policies/{id}/identities", @@ -281,7 +303,12 @@ func (a *Client) ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIden 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 } @@ -300,13 +327,12 @@ func (a *Client) ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIden Update the supplied fields on an edge router policy. Requires admin access. */ -func (a *Client) PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchEdgeRouterPolicyOK, error) { +func (a *Client) PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchEdgeRouterPolicy", Method: "PATCH", PathPattern: "/edge-router-policies/{id}", @@ -318,7 +344,12 @@ func (a *Client) PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, auth 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 } @@ -337,13 +368,12 @@ func (a *Client) PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, auth Update all fields on an edge router policy by id. Requires admin access. */ -func (a *Client) UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateEdgeRouterPolicyOK, error) { +func (a *Client) UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateEdgeRouterPolicy", Method: "PUT", PathPattern: "/edge-router-policies/{id}", @@ -355,7 +385,12 @@ func (a *Client) UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, au 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 } diff --git a/rest_client/edge_router_policy/list_edge_router_policies_parameters.go b/rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go similarity index 83% rename from rest_client/edge_router_policy/list_edge_router_policies_parameters.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go index a8e767a4c..9670f93cb 100644 --- a/rest_client/edge_router_policy/list_edge_router_policies_parameters.go +++ b/rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListEdgeRouterPoliciesParams creates a new ListEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPoliciesParams { - var () return &ListEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterPoliciesParams { - var () return &ListEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPoliciesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListEdgeRouterPoliciesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, r // 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 { diff --git a/rest_client/edge_router_policy/list_edge_router_policies_responses.go b/rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go similarity index 95% rename from rest_client/edge_router_policy/list_edge_router_policies_responses.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go index 1f9b3cce3..43d56d43a 100644 --- a/rest_client/edge_router_policy/list_edge_router_policies_responses.go +++ b/rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go @@ -59,7 +59,6 @@ func (o *ListEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -70,7 +69,7 @@ func NewListEdgeRouterPoliciesOK() *ListEdgeRouterPoliciesOK { return &ListEdgeRouterPoliciesOK{} } -/*ListEdgeRouterPoliciesOK handles this case with default header values. +/* ListEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of edge router policies */ @@ -81,7 +80,6 @@ type ListEdgeRouterPoliciesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListEdgeRouterPoliciesUnauthorized() *ListEdgeRouterPoliciesUnauthorized return &ListEdgeRouterPoliciesUnauthorized{} } -/*ListEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListEdgeRouterPoliciesUnauthorized struct { 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go index 321b45f1a..72d9a5da3 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterPolicyEdgeRoutersParams creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterPolicyEdgeRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterPolicyEdgeRoutersParamsWithTimeout creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterPolicyEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPolicyEdgeRoutersParams { - var () return &ListEdgeRouterPolicyEdgeRoutersParams{ - timeout: timeout, } } // NewListEdgeRouterPolicyEdgeRoutersParamsWithContext creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterPolicyEdgeRoutersParamsWithContext(ctx context.Context) *ListEdgeRouterPolicyEdgeRoutersParams { - var () return &ListEdgeRouterPolicyEdgeRoutersParams{ - Context: ctx, } } // NewListEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPolicyEdgeRoutersParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterPolicyEdgeRoutersParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/edge_router_policy/list_edge_router_policy_edge_routers_responses.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_responses.go index 29db54390..de12d1d7c 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListEdgeRouterPolicyEdgeRoutersReader) ReadResponse(response runtime.Cl 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterPolicyEdgeRoutersOK() *ListEdgeRouterPolicyEdgeRoutersOK { return &ListEdgeRouterPolicyEdgeRoutersOK{} } -/*ListEdgeRouterPolicyEdgeRoutersOK handles this case with default header values. +/* ListEdgeRouterPolicyEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -87,7 +86,6 @@ type ListEdgeRouterPolicyEdgeRoutersOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterPolicyEdgeRoutersUnauthorized() *ListEdgeRouterPolicyEdgeR return &ListEdgeRouterPolicyEdgeRoutersUnauthorized{} } -/*ListEdgeRouterPolicyEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterPolicyEdgeRoutersUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterPolicyEdgeRoutersNotFound() *ListEdgeRouterPolicyEdgeRoute return &ListEdgeRouterPolicyEdgeRoutersNotFound{} } -/*ListEdgeRouterPolicyEdgeRoutersNotFound handles this case with default header values. +/* ListEdgeRouterPolicyEdgeRoutersNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterPolicyEdgeRoutersNotFound struct { 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/edge_router_policy/list_edge_router_policy_identities_parameters.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_parameters.go index ce827debb..452fbb97c 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListEdgeRouterPolicyIdentitiesParams creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterPolicyIdentitiesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterPolicyIdentitiesParamsWithTimeout creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterPolicyIdentitiesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPolicyIdentitiesParams { - var () return &ListEdgeRouterPolicyIdentitiesParams{ - timeout: timeout, } } // NewListEdgeRouterPolicyIdentitiesParamsWithContext creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterPolicyIdentitiesParamsWithContext(ctx context.Context) *ListEdgeRouterPolicyIdentitiesParams { - var () return &ListEdgeRouterPolicyIdentitiesParams{ - Context: ctx, } } // NewListEdgeRouterPolicyIdentitiesParamsWithHTTPClient creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterPolicyIdentitiesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPolicyIdentitiesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListEdgeRouterPolicyIdentitiesParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/edge_router_policy/list_edge_router_policy_identities_responses.go rename to rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_responses.go index a557fb320..01bd097bf 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListEdgeRouterPolicyIdentitiesReader) ReadResponse(response runtime.Cli 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()) } @@ -76,7 +75,7 @@ func NewListEdgeRouterPolicyIdentitiesOK() *ListEdgeRouterPolicyIdentitiesOK { return &ListEdgeRouterPolicyIdentitiesOK{} } -/*ListEdgeRouterPolicyIdentitiesOK handles this case with default header values. +/* ListEdgeRouterPolicyIdentitiesOK describes a response with status code 200, with default header values. A list of identities */ @@ -87,7 +86,6 @@ type ListEdgeRouterPolicyIdentitiesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListEdgeRouterPolicyIdentitiesUnauthorized() *ListEdgeRouterPolicyIdenti return &ListEdgeRouterPolicyIdentitiesUnauthorized{} } -/*ListEdgeRouterPolicyIdentitiesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListEdgeRouterPolicyIdentitiesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListEdgeRouterPolicyIdentitiesNotFound() *ListEdgeRouterPolicyIdentities return &ListEdgeRouterPolicyIdentitiesNotFound{} } -/*ListEdgeRouterPolicyIdentitiesNotFound handles this case with default header values. +/* ListEdgeRouterPolicyIdentitiesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListEdgeRouterPolicyIdentitiesNotFound struct { 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 } diff --git a/rest_client/edge_router_policy/patch_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go similarity index 80% rename from rest_client/edge_router_policy/patch_edge_router_policy_parameters.go rename to rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go index 9922ec1f9..b9556eb96 100644 --- a/rest_client/edge_router_policy/patch_edge_router_policy_parameters.go +++ b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchEdgeRouterPolicyParams creates a new PatchEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &PatchEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewPatchEdgeRouterPolicyParamsWithTimeout creates a new PatchEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *PatchEdgeRouterPolicyParams { - var () return &PatchEdgeRouterPolicyParams{ - timeout: timeout, } } // NewPatchEdgeRouterPolicyParamsWithContext creates a new PatchEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchEdgeRouterPolicyParamsWithContext(ctx context.Context) *PatchEdgeRouterPolicyParams { - var () return &PatchEdgeRouterPolicyParams{ - Context: ctx, } } // NewPatchEdgeRouterPolicyParamsWithHTTPClient creates a new PatchEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *PatchEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - An edge router policy patch object + /* Policy. + + An edge router policy patch object */ Policy *rest_model.EdgeRouterPolicyPatch @@ -102,6 +102,21 @@ type PatchEdgeRouterPolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, re 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 diff --git a/rest_client/edge_router_policy/patch_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go similarity index 94% rename from rest_client/edge_router_policy/patch_edge_router_policy_responses.go rename to rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go index c454c8845..73a4b9556 100644 --- a/rest_client/edge_router_policy/patch_edge_router_policy_responses.go +++ b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go @@ -71,7 +71,6 @@ func (o *PatchEdgeRouterPolicyReader) ReadResponse(response runtime.ClientRespon 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()) } @@ -82,7 +81,7 @@ func NewPatchEdgeRouterPolicyOK() *PatchEdgeRouterPolicyOK { return &PatchEdgeRouterPolicyOK{} } -/*PatchEdgeRouterPolicyOK handles this case with default header values. +/* PatchEdgeRouterPolicyOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchEdgeRouterPolicyBadRequest() *PatchEdgeRouterPolicyBadRequest { return &PatchEdgeRouterPolicyBadRequest{} } -/*PatchEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchEdgeRouterPolicyUnauthorized() *PatchEdgeRouterPolicyUnauthorized { return &PatchEdgeRouterPolicyUnauthorized{} } -/*PatchEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchEdgeRouterPolicyNotFound() *PatchEdgeRouterPolicyNotFound { return &PatchEdgeRouterPolicyNotFound{} } -/*PatchEdgeRouterPolicyNotFound handles this case with default header values. +/* PatchEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_client/edge_router_policy/update_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go similarity index 80% rename from rest_client/edge_router_policy/update_edge_router_policy_parameters.go rename to rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go index 049dde946..5055c7529 100644 --- a/rest_client/edge_router_policy/update_edge_router_policy_parameters.go +++ b/rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateEdgeRouterPolicyParams creates a new UpdateEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &UpdateEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateEdgeRouterPolicyParamsWithTimeout creates a new UpdateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *UpdateEdgeRouterPolicyParams { - var () return &UpdateEdgeRouterPolicyParams{ - timeout: timeout, } } // NewUpdateEdgeRouterPolicyParamsWithContext creates a new UpdateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateEdgeRouterPolicyParamsWithContext(ctx context.Context) *UpdateEdgeRouterPolicyParams { - var () return &UpdateEdgeRouterPolicyParams{ - Context: ctx, } } // NewUpdateEdgeRouterPolicyParamsWithHTTPClient creates a new UpdateEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *UpdateEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - An edge router policy update object + /* Policy. + + An edge router policy update object */ Policy *rest_model.EdgeRouterPolicyUpdate @@ -102,6 +102,21 @@ type UpdateEdgeRouterPolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, r 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 diff --git a/rest_client/edge_router_policy/update_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go similarity index 94% rename from rest_client/edge_router_policy/update_edge_router_policy_responses.go rename to rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go index 45d40ddac..877667094 100644 --- a/rest_client/edge_router_policy/update_edge_router_policy_responses.go +++ b/rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go @@ -71,7 +71,6 @@ func (o *UpdateEdgeRouterPolicyReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -82,7 +81,7 @@ func NewUpdateEdgeRouterPolicyOK() *UpdateEdgeRouterPolicyOK { return &UpdateEdgeRouterPolicyOK{} } -/*UpdateEdgeRouterPolicyOK handles this case with default header values. +/* UpdateEdgeRouterPolicyOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateEdgeRouterPolicyBadRequest() *UpdateEdgeRouterPolicyBadRequest { return &UpdateEdgeRouterPolicyBadRequest{} } -/*UpdateEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateEdgeRouterPolicyUnauthorized() *UpdateEdgeRouterPolicyUnauthorized return &UpdateEdgeRouterPolicyUnauthorized{} } -/*UpdateEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateEdgeRouterPolicyNotFound() *UpdateEdgeRouterPolicyNotFound { return &UpdateEdgeRouterPolicyNotFound{} } -/*UpdateEdgeRouterPolicyNotFound handles this case with default header values. +/* UpdateEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_client/enrollment/delete_enrollment_parameters.go b/rest_management_api_client/enrollment/delete_enrollment_parameters.go similarity index 78% rename from rest_client/enrollment/delete_enrollment_parameters.go rename to rest_management_api_client/enrollment/delete_enrollment_parameters.go index 79f24e6b5..6bc86a1ed 100644 --- a/rest_client/enrollment/delete_enrollment_parameters.go +++ b/rest_management_api_client/enrollment/delete_enrollment_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteEnrollmentParams creates a new DeleteEnrollmentParams object -// with the default values initialized. +// 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 { - var () return &DeleteEnrollmentParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteEnrollmentParamsWithTimeout creates a new DeleteEnrollmentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteEnrollmentParamsWithTimeout(timeout time.Duration) *DeleteEnrollmentParams { - var () return &DeleteEnrollmentParams{ - timeout: timeout, } } // NewDeleteEnrollmentParamsWithContext creates a new DeleteEnrollmentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteEnrollmentParamsWithContext(ctx context.Context) *DeleteEnrollmentParams { - var () return &DeleteEnrollmentParams{ - Context: ctx, } } // NewDeleteEnrollmentParamsWithHTTPClient creates a new DeleteEnrollmentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteEnrollmentParamsWithHTTPClient(client *http.Client) *DeleteEnrollmentParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteEnrollmentParams struct { 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) diff --git a/rest_client/enrollment/delete_enrollment_responses.go b/rest_management_api_client/enrollment/delete_enrollment_responses.go similarity index 94% rename from rest_client/enrollment/delete_enrollment_responses.go rename to rest_management_api_client/enrollment/delete_enrollment_responses.go index 119c18733..fcec7a571 100644 --- a/rest_client/enrollment/delete_enrollment_responses.go +++ b/rest_management_api_client/enrollment/delete_enrollment_responses.go @@ -65,7 +65,6 @@ func (o *DeleteEnrollmentReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewDeleteEnrollmentOK() *DeleteEnrollmentOK { return &DeleteEnrollmentOK{} } -/*DeleteEnrollmentOK handles this case with default header values. +/* DeleteEnrollmentOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeleteEnrollmentOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeleteEnrollmentBadRequest() *DeleteEnrollmentBadRequest { return &DeleteEnrollmentBadRequest{} } -/*DeleteEnrollmentBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeleteEnrollmentBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewDeleteEnrollmentUnauthorized() *DeleteEnrollmentUnauthorized { return &DeleteEnrollmentUnauthorized{} } -/*DeleteEnrollmentUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type DeleteEnrollmentUnauthorized struct { 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 } diff --git a/rest_client/enrollment/detail_enrollment_parameters.go b/rest_management_api_client/enrollment/detail_enrollment_parameters.go similarity index 78% rename from rest_client/enrollment/detail_enrollment_parameters.go rename to rest_management_api_client/enrollment/detail_enrollment_parameters.go index 3051c6633..cede4796a 100644 --- a/rest_client/enrollment/detail_enrollment_parameters.go +++ b/rest_management_api_client/enrollment/detail_enrollment_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailEnrollmentParams creates a new DetailEnrollmentParams object -// with the default values initialized. +// 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 { - var () return &DetailEnrollmentParams{ - timeout: cr.DefaultTimeout, } } // NewDetailEnrollmentParamsWithTimeout creates a new DetailEnrollmentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailEnrollmentParamsWithTimeout(timeout time.Duration) *DetailEnrollmentParams { - var () return &DetailEnrollmentParams{ - timeout: timeout, } } // NewDetailEnrollmentParamsWithContext creates a new DetailEnrollmentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailEnrollmentParamsWithContext(ctx context.Context) *DetailEnrollmentParams { - var () return &DetailEnrollmentParams{ - Context: ctx, } } // NewDetailEnrollmentParamsWithHTTPClient creates a new DetailEnrollmentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailEnrollmentParamsWithHTTPClient(client *http.Client) *DetailEnrollmentParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailEnrollmentParams struct { 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) diff --git a/rest_client/enrollment/detail_enrollment_responses.go b/rest_management_api_client/enrollment/detail_enrollment_responses.go similarity index 94% rename from rest_client/enrollment/detail_enrollment_responses.go rename to rest_management_api_client/enrollment/detail_enrollment_responses.go index d56277da0..0d89f012a 100644 --- a/rest_client/enrollment/detail_enrollment_responses.go +++ b/rest_management_api_client/enrollment/detail_enrollment_responses.go @@ -65,7 +65,6 @@ func (o *DetailEnrollmentReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewDetailEnrollmentOK() *DetailEnrollmentOK { return &DetailEnrollmentOK{} } -/*DetailEnrollmentOK handles this case with default header values. +/* DetailEnrollmentOK describes a response with status code 200, with default header values. A singular enrollment resource */ @@ -87,7 +86,6 @@ type DetailEnrollmentOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailEnrollmentUnauthorized() *DetailEnrollmentUnauthorized { return &DetailEnrollmentUnauthorized{} } -/*DetailEnrollmentUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailEnrollmentUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailEnrollmentNotFound() *DetailEnrollmentNotFound { return &DetailEnrollmentNotFound{} } -/*DetailEnrollmentNotFound handles this case with default header values. +/* DetailEnrollmentNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailEnrollmentNotFound struct { 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 } diff --git a/rest_client/enrollment/enrollment_client.go b/rest_management_api_client/enrollment/enrollment_client.go similarity index 85% rename from rest_client/enrollment/enrollment_client.go rename to rest_management_api_client/enrollment/enrollment_client.go index 41479589d..94b7c6532 100644 --- a/rest_client/enrollment/enrollment_client.go +++ b/rest_management_api_client/enrollment/enrollment_client.go @@ -49,13 +49,16 @@ type Client struct { 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 { - DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEnrollmentOK, error) + DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentOK, error) - DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEnrollmentOK, error) + DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEnrollmentOK, error) - ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter) (*ListEnrollmentsOK, error) + ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnrollmentsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -65,13 +68,12 @@ type ClientService interface { Delete an outstanding enrollment by id. Requires admin access. */ -func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteEnrollmentOK, error) { +func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteEnrollmentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteEnrollment", Method: "DELETE", PathPattern: "/enrollments/{id}", @@ -83,7 +85,12 @@ func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runti 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 } @@ -102,13 +109,12 @@ func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runti Retrieves a single outstanding enrollment by id. Requires admin access. */ -func (a *Client) DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter) (*DetailEnrollmentOK, error) { +func (a *Client) DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEnrollmentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailEnrollmentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailEnrollment", Method: "GET", PathPattern: "/enrollments/{id}", @@ -120,7 +126,12 @@ func (a *Client) DetailEnrollment(params *DetailEnrollmentParams, authInfo runti 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 } @@ -140,13 +151,12 @@ func (a *Client) DetailEnrollment(params *DetailEnrollmentParams, authInfo runti Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter) (*ListEnrollmentsOK, error) { +func (a *Client) ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnrollmentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEnrollmentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEnrollments", Method: "GET", PathPattern: "/enrollments", @@ -158,7 +168,12 @@ func (a *Client) ListEnrollments(params *ListEnrollmentsParams, authInfo runtime 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 } diff --git a/rest_client/enrollment/list_enrollments_parameters.go b/rest_management_api_client/enrollment/list_enrollments_parameters.go similarity index 83% rename from rest_client/enrollment/list_enrollments_parameters.go rename to rest_management_api_client/enrollment/list_enrollments_parameters.go index 74e019520..d87382915 100644 --- a/rest_client/enrollment/list_enrollments_parameters.go +++ b/rest_management_api_client/enrollment/list_enrollments_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListEnrollmentsParams creates a new ListEnrollmentsParams object -// with the default values initialized. +// 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 { - var () return &ListEnrollmentsParams{ - timeout: cr.DefaultTimeout, } } // NewListEnrollmentsParamsWithTimeout creates a new ListEnrollmentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEnrollmentsParamsWithTimeout(timeout time.Duration) *ListEnrollmentsParams { - var () return &ListEnrollmentsParams{ - timeout: timeout, } } // NewListEnrollmentsParamsWithContext creates a new ListEnrollmentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEnrollmentsParamsWithContext(ctx context.Context) *ListEnrollmentsParams { - var () return &ListEnrollmentsParams{ - Context: ctx, } } // NewListEnrollmentsParamsWithHTTPClient creates a new ListEnrollmentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEnrollmentsParamsWithHTTPClient(client *http.Client) *ListEnrollmentsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListEnrollmentsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListEnrollmentsParams) WriteToRequest(r runtime.ClientRequest, reg strf // 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 { diff --git a/rest_client/enrollment/list_enrollments_responses.go b/rest_management_api_client/enrollment/list_enrollments_responses.go similarity index 95% rename from rest_client/enrollment/list_enrollments_responses.go rename to rest_management_api_client/enrollment/list_enrollments_responses.go index 24746248f..60b85be69 100644 --- a/rest_client/enrollment/list_enrollments_responses.go +++ b/rest_management_api_client/enrollment/list_enrollments_responses.go @@ -59,7 +59,6 @@ func (o *ListEnrollmentsReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -70,7 +69,7 @@ func NewListEnrollmentsOK() *ListEnrollmentsOK { return &ListEnrollmentsOK{} } -/*ListEnrollmentsOK handles this case with default header values. +/* ListEnrollmentsOK describes a response with status code 200, with default header values. A list of enrollments */ @@ -81,7 +80,6 @@ type ListEnrollmentsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListEnrollmentsUnauthorized() *ListEnrollmentsUnauthorized { return &ListEnrollmentsUnauthorized{} } -/*ListEnrollmentsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListEnrollmentsUnauthorized struct { 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 } diff --git a/rest_client/identity/associate_identitys_service_configs_parameters.go b/rest_management_api_client/identity/associate_identitys_service_configs_parameters.go similarity index 80% rename from rest_client/identity/associate_identitys_service_configs_parameters.go rename to rest_management_api_client/identity/associate_identitys_service_configs_parameters.go index 84e13fecd..77fab23a3 100644 --- a/rest_client/identity/associate_identitys_service_configs_parameters.go +++ b/rest_management_api_client/identity/associate_identitys_service_configs_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewAssociateIdentitysServiceConfigsParams creates a new AssociateIdentitysServiceConfigsParams object -// with the default values initialized. +// 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 { - var () return &AssociateIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, } } // NewAssociateIdentitysServiceConfigsParamsWithTimeout creates a new AssociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAssociateIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *AssociateIdentitysServiceConfigsParams { - var () return &AssociateIdentitysServiceConfigsParams{ - timeout: timeout, } } // NewAssociateIdentitysServiceConfigsParamsWithContext creates a new AssociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAssociateIdentitysServiceConfigsParamsWithContext(ctx context.Context) *AssociateIdentitysServiceConfigsParams { - var () return &AssociateIdentitysServiceConfigsParams{ - Context: ctx, } } // NewAssociateIdentitysServiceConfigsParamsWithHTTPClient creates a new AssociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAssociateIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *AssociateIdentitysServiceConfigsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*ServiceConfigs - A service config patch object + /* ServiceConfigs. + + A service config patch object */ ServiceConfigs rest_model.ServiceConfigsAssignList @@ -102,6 +102,21 @@ type AssociateIdentitysServiceConfigsParams struct { 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) @@ -169,7 +184,6 @@ func (o *AssociateIdentitysServiceConfigsParams) WriteToRequest(r runtime.Client 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 diff --git a/rest_client/identity/associate_identitys_service_configs_responses.go b/rest_management_api_client/identity/associate_identitys_service_configs_responses.go similarity index 93% rename from rest_client/identity/associate_identitys_service_configs_responses.go rename to rest_management_api_client/identity/associate_identitys_service_configs_responses.go index ed2faa8c3..2b561fde9 100644 --- a/rest_client/identity/associate_identitys_service_configs_responses.go +++ b/rest_management_api_client/identity/associate_identitys_service_configs_responses.go @@ -71,7 +71,6 @@ func (o *AssociateIdentitysServiceConfigsReader) ReadResponse(response runtime.C 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()) } @@ -82,7 +81,7 @@ func NewAssociateIdentitysServiceConfigsOK() *AssociateIdentitysServiceConfigsOK return &AssociateIdentitysServiceConfigsOK{} } -/*AssociateIdentitysServiceConfigsOK handles this case with default header values. +/* AssociateIdentitysServiceConfigsOK describes a response with status code 200, with default header values. Base empty response */ @@ -93,7 +92,6 @@ type AssociateIdentitysServiceConfigsOK struct { 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 } @@ -115,7 +113,7 @@ func NewAssociateIdentitysServiceConfigsBadRequest() *AssociateIdentitysServiceC return &AssociateIdentitysServiceConfigsBadRequest{} } -/*AssociateIdentitysServiceConfigsBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type AssociateIdentitysServiceConfigsBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewAssociateIdentitysServiceConfigsUnauthorized() *AssociateIdentitysServic return &AssociateIdentitysServiceConfigsUnauthorized{} } -/*AssociateIdentitysServiceConfigsUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type AssociateIdentitysServiceConfigsUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewAssociateIdentitysServiceConfigsNotFound() *AssociateIdentitysServiceCon return &AssociateIdentitysServiceConfigsNotFound{} } -/*AssociateIdentitysServiceConfigsNotFound handles this case with default header values. +/* AssociateIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type AssociateIdentitysServiceConfigsNotFound struct { 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 } diff --git a/rest_client/identity/create_identity_parameters.go b/rest_management_api_client/identity/create_identity_parameters.go similarity index 79% rename from rest_client/identity/create_identity_parameters.go rename to rest_management_api_client/identity/create_identity_parameters.go index 0b3716124..67a8d9180 100644 --- a/rest_client/identity/create_identity_parameters.go +++ b/rest_management_api_client/identity/create_identity_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateIdentityParams creates a new CreateIdentityParams object -// with the default values initialized. +// 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 { - var () return &CreateIdentityParams{ - timeout: cr.DefaultTimeout, } } // NewCreateIdentityParamsWithTimeout creates a new CreateIdentityParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateIdentityParamsWithTimeout(timeout time.Duration) *CreateIdentityParams { - var () return &CreateIdentityParams{ - timeout: timeout, } } // NewCreateIdentityParamsWithContext creates a new CreateIdentityParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateIdentityParamsWithContext(ctx context.Context) *CreateIdentityParams { - var () return &CreateIdentityParams{ - Context: ctx, } } // NewCreateIdentityParamsWithHTTPClient creates a new CreateIdentityParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateIdentityParamsWithHTTPClient(client *http.Client) *CreateIdentityParams { - var () 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 +/* 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. + An identity to create */ Identity *rest_model.IdentityCreate @@ -97,6 +96,21 @@ type CreateIdentityParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if o.Identity != nil { if err := r.SetBodyParam(o.Identity); err != nil { return err diff --git a/rest_client/identity/create_identity_responses.go b/rest_management_api_client/identity/create_identity_responses.go similarity index 94% rename from rest_client/identity/create_identity_responses.go rename to rest_management_api_client/identity/create_identity_responses.go index 4c2da5f26..671976663 100644 --- a/rest_client/identity/create_identity_responses.go +++ b/rest_management_api_client/identity/create_identity_responses.go @@ -65,7 +65,6 @@ func (o *CreateIdentityReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -76,7 +75,7 @@ func NewCreateIdentityCreated() *CreateIdentityCreated { return &CreateIdentityCreated{} } -/*CreateIdentityCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateIdentityCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateIdentityBadRequest() *CreateIdentityBadRequest { return &CreateIdentityBadRequest{} } -/*CreateIdentityBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateIdentityBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateIdentityUnauthorized() *CreateIdentityUnauthorized { return &CreateIdentityUnauthorized{} } -/*CreateIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateIdentityUnauthorized struct { 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 } diff --git a/rest_client/identity/delete_identity_parameters.go b/rest_management_api_client/identity/delete_identity_parameters.go similarity index 78% rename from rest_client/identity/delete_identity_parameters.go rename to rest_management_api_client/identity/delete_identity_parameters.go index cf7749304..83a593415 100644 --- a/rest_client/identity/delete_identity_parameters.go +++ b/rest_management_api_client/identity/delete_identity_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteIdentityParams creates a new DeleteIdentityParams object -// with the default values initialized. +// 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 { - var () return &DeleteIdentityParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteIdentityParamsWithTimeout creates a new DeleteIdentityParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteIdentityParamsWithTimeout(timeout time.Duration) *DeleteIdentityParams { - var () return &DeleteIdentityParams{ - timeout: timeout, } } // NewDeleteIdentityParamsWithContext creates a new DeleteIdentityParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteIdentityParamsWithContext(ctx context.Context) *DeleteIdentityParams { - var () return &DeleteIdentityParams{ - Context: ctx, } } // NewDeleteIdentityParamsWithHTTPClient creates a new DeleteIdentityParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteIdentityParamsWithHTTPClient(client *http.Client) *DeleteIdentityParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteIdentityParams struct { 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) diff --git a/rest_client/identity/delete_identity_responses.go b/rest_management_api_client/identity/delete_identity_responses.go similarity index 94% rename from rest_client/identity/delete_identity_responses.go rename to rest_management_api_client/identity/delete_identity_responses.go index 4dabeb76f..1fc536bf8 100644 --- a/rest_client/identity/delete_identity_responses.go +++ b/rest_management_api_client/identity/delete_identity_responses.go @@ -71,7 +71,6 @@ func (o *DeleteIdentityReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -82,7 +81,7 @@ func NewDeleteIdentityOK() *DeleteIdentityOK { return &DeleteIdentityOK{} } -/*DeleteIdentityOK handles this case with default header values. +/* DeleteIdentityOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteIdentityOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteIdentityBadRequest() *DeleteIdentityBadRequest { return &DeleteIdentityBadRequest{} } -/*DeleteIdentityBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteIdentityBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteIdentityUnauthorized() *DeleteIdentityUnauthorized { return &DeleteIdentityUnauthorized{} } -/*DeleteIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteIdentityUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteIdentityConflict() *DeleteIdentityConflict { return &DeleteIdentityConflict{} } -/*DeleteIdentityConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteIdentityConflict struct { 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 } diff --git a/rest_client/identity/detail_identity_parameters.go b/rest_management_api_client/identity/detail_identity_parameters.go similarity index 78% rename from rest_client/identity/detail_identity_parameters.go rename to rest_management_api_client/identity/detail_identity_parameters.go index 8e86ce552..382b0c7ac 100644 --- a/rest_client/identity/detail_identity_parameters.go +++ b/rest_management_api_client/identity/detail_identity_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailIdentityParams creates a new DetailIdentityParams object -// with the default values initialized. +// 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 { - var () return &DetailIdentityParams{ - timeout: cr.DefaultTimeout, } } // NewDetailIdentityParamsWithTimeout creates a new DetailIdentityParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailIdentityParamsWithTimeout(timeout time.Duration) *DetailIdentityParams { - var () return &DetailIdentityParams{ - timeout: timeout, } } // NewDetailIdentityParamsWithContext creates a new DetailIdentityParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailIdentityParamsWithContext(ctx context.Context) *DetailIdentityParams { - var () return &DetailIdentityParams{ - Context: ctx, } } // NewDetailIdentityParamsWithHTTPClient creates a new DetailIdentityParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailIdentityParamsWithHTTPClient(client *http.Client) *DetailIdentityParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailIdentityParams struct { 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) diff --git a/rest_client/identity/detail_identity_responses.go b/rest_management_api_client/identity/detail_identity_responses.go similarity index 94% rename from rest_client/identity/detail_identity_responses.go rename to rest_management_api_client/identity/detail_identity_responses.go index 06edc3ce4..a96dcb050 100644 --- a/rest_client/identity/detail_identity_responses.go +++ b/rest_management_api_client/identity/detail_identity_responses.go @@ -65,7 +65,6 @@ func (o *DetailIdentityReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -76,7 +75,7 @@ func NewDetailIdentityOK() *DetailIdentityOK { return &DetailIdentityOK{} } -/*DetailIdentityOK handles this case with default header values. +/* DetailIdentityOK describes a response with status code 200, with default header values. A signle identity */ @@ -87,7 +86,6 @@ type DetailIdentityOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailIdentityUnauthorized() *DetailIdentityUnauthorized { return &DetailIdentityUnauthorized{} } -/*DetailIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailIdentityUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailIdentityNotFound() *DetailIdentityNotFound { return &DetailIdentityNotFound{} } -/*DetailIdentityNotFound handles this case with default header values. +/* DetailIdentityNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailIdentityNotFound struct { 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 } diff --git a/rest_client/identity/detail_identity_type_parameters.go b/rest_management_api_client/identity/detail_identity_type_parameters.go similarity index 78% rename from rest_client/identity/detail_identity_type_parameters.go rename to rest_management_api_client/identity/detail_identity_type_parameters.go index 209cdf511..8d24e3020 100644 --- a/rest_client/identity/detail_identity_type_parameters.go +++ b/rest_management_api_client/identity/detail_identity_type_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailIdentityTypeParams creates a new DetailIdentityTypeParams object -// with the default values initialized. +// 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 { - var () return &DetailIdentityTypeParams{ - timeout: cr.DefaultTimeout, } } // NewDetailIdentityTypeParamsWithTimeout creates a new DetailIdentityTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailIdentityTypeParamsWithTimeout(timeout time.Duration) *DetailIdentityTypeParams { - var () return &DetailIdentityTypeParams{ - timeout: timeout, } } // NewDetailIdentityTypeParamsWithContext creates a new DetailIdentityTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailIdentityTypeParamsWithContext(ctx context.Context) *DetailIdentityTypeParams { - var () return &DetailIdentityTypeParams{ - Context: ctx, } } // NewDetailIdentityTypeParamsWithHTTPClient creates a new DetailIdentityTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailIdentityTypeParamsWithHTTPClient(client *http.Client) *DetailIdentityTypeParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailIdentityTypeParams struct { 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) diff --git a/rest_client/identity/detail_identity_type_responses.go b/rest_management_api_client/identity/detail_identity_type_responses.go similarity index 94% rename from rest_client/identity/detail_identity_type_responses.go rename to rest_management_api_client/identity/detail_identity_type_responses.go index c24060014..3fd923b82 100644 --- a/rest_client/identity/detail_identity_type_responses.go +++ b/rest_management_api_client/identity/detail_identity_type_responses.go @@ -65,7 +65,6 @@ func (o *DetailIdentityTypeReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewDetailIdentityTypeOK() *DetailIdentityTypeOK { return &DetailIdentityTypeOK{} } -/*DetailIdentityTypeOK handles this case with default header values. +/* DetailIdentityTypeOK describes a response with status code 200, with default header values. A single identity type */ @@ -87,7 +86,6 @@ type DetailIdentityTypeOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailIdentityTypeUnauthorized() *DetailIdentityTypeUnauthorized { return &DetailIdentityTypeUnauthorized{} } -/*DetailIdentityTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailIdentityTypeUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailIdentityTypeNotFound() *DetailIdentityTypeNotFound { return &DetailIdentityTypeNotFound{} } -/*DetailIdentityTypeNotFound handles this case with default header values. +/* DetailIdentityTypeNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailIdentityTypeNotFound struct { 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 } diff --git a/rest_client/identity/disassociate_identitys_service_configs_parameters.go b/rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go similarity index 80% rename from rest_client/identity/disassociate_identitys_service_configs_parameters.go rename to rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go index 9a14717f7..dede525a4 100644 --- a/rest_client/identity/disassociate_identitys_service_configs_parameters.go +++ b/rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewDisassociateIdentitysServiceConfigsParams creates a new DisassociateIdentitysServiceConfigsParams object -// with the default values initialized. +// 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 { - var () return &DisassociateIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, } } // NewDisassociateIdentitysServiceConfigsParamsWithTimeout creates a new DisassociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDisassociateIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *DisassociateIdentitysServiceConfigsParams { - var () return &DisassociateIdentitysServiceConfigsParams{ - timeout: timeout, } } // NewDisassociateIdentitysServiceConfigsParamsWithContext creates a new DisassociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDisassociateIdentitysServiceConfigsParamsWithContext(ctx context.Context) *DisassociateIdentitysServiceConfigsParams { - var () return &DisassociateIdentitysServiceConfigsParams{ - Context: ctx, } } // NewDisassociateIdentitysServiceConfigsParamsWithHTTPClient creates a new DisassociateIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDisassociateIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *DisassociateIdentitysServiceConfigsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*ServiceConfigIDPairs - An array of service and config id pairs to remove + /* ServiceConfigIDPairs. + + An array of service and config id pairs to remove */ ServiceConfigIDPairs rest_model.ServiceConfigsAssignList @@ -102,6 +102,21 @@ type DisassociateIdentitysServiceConfigsParams struct { 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) @@ -169,7 +184,6 @@ func (o *DisassociateIdentitysServiceConfigsParams) WriteToRequest(r runtime.Cli 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 diff --git a/rest_client/identity/disassociate_identitys_service_configs_responses.go b/rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go similarity index 93% rename from rest_client/identity/disassociate_identitys_service_configs_responses.go rename to rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go index 71a12d7fb..5186c547d 100644 --- a/rest_client/identity/disassociate_identitys_service_configs_responses.go +++ b/rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go @@ -71,7 +71,6 @@ func (o *DisassociateIdentitysServiceConfigsReader) ReadResponse(response runtim 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()) } @@ -82,7 +81,7 @@ func NewDisassociateIdentitysServiceConfigsOK() *DisassociateIdentitysServiceCon return &DisassociateIdentitysServiceConfigsOK{} } -/*DisassociateIdentitysServiceConfigsOK handles this case with default header values. +/* DisassociateIdentitysServiceConfigsOK describes a response with status code 200, with default header values. Base empty response */ @@ -93,7 +92,6 @@ type DisassociateIdentitysServiceConfigsOK struct { 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 } @@ -115,7 +113,7 @@ func NewDisassociateIdentitysServiceConfigsBadRequest() *DisassociateIdentitysSe return &DisassociateIdentitysServiceConfigsBadRequest{} } -/*DisassociateIdentitysServiceConfigsBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DisassociateIdentitysServiceConfigsBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDisassociateIdentitysServiceConfigsUnauthorized() *DisassociateIdentitys return &DisassociateIdentitysServiceConfigsUnauthorized{} } -/*DisassociateIdentitysServiceConfigsUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DisassociateIdentitysServiceConfigsUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDisassociateIdentitysServiceConfigsNotFound() *DisassociateIdentitysServ return &DisassociateIdentitysServiceConfigsNotFound{} } -/*DisassociateIdentitysServiceConfigsNotFound handles this case with default header values. +/* DisassociateIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type DisassociateIdentitysServiceConfigsNotFound struct { 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 } diff --git a/rest_client/identity/get_identity_failed_service_requests_parameters.go b/rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go similarity index 78% rename from rest_client/identity/get_identity_failed_service_requests_parameters.go rename to rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go index bde0645d6..9c0868627 100644 --- a/rest_client/identity/get_identity_failed_service_requests_parameters.go +++ b/rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetIdentityFailedServiceRequestsParams creates a new GetIdentityFailedServiceRequestsParams object -// with the default values initialized. +// 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 { - var () return &GetIdentityFailedServiceRequestsParams{ - timeout: cr.DefaultTimeout, } } // NewGetIdentityFailedServiceRequestsParamsWithTimeout creates a new GetIdentityFailedServiceRequestsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetIdentityFailedServiceRequestsParamsWithTimeout(timeout time.Duration) *GetIdentityFailedServiceRequestsParams { - var () return &GetIdentityFailedServiceRequestsParams{ - timeout: timeout, } } // NewGetIdentityFailedServiceRequestsParamsWithContext creates a new GetIdentityFailedServiceRequestsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetIdentityFailedServiceRequestsParamsWithContext(ctx context.Context) *GetIdentityFailedServiceRequestsParams { - var () return &GetIdentityFailedServiceRequestsParams{ - Context: ctx, } } // NewGetIdentityFailedServiceRequestsParamsWithHTTPClient creates a new GetIdentityFailedServiceRequestsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetIdentityFailedServiceRequestsParamsWithHTTPClient(client *http.Client) *GetIdentityFailedServiceRequestsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type GetIdentityFailedServiceRequestsParams struct { 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) diff --git a/rest_client/identity/get_identity_failed_service_requests_responses.go b/rest_management_api_client/identity/get_identity_failed_service_requests_responses.go similarity index 92% rename from rest_client/identity/get_identity_failed_service_requests_responses.go rename to rest_management_api_client/identity/get_identity_failed_service_requests_responses.go index 8d32f8bc8..6c5177ff1 100644 --- a/rest_client/identity/get_identity_failed_service_requests_responses.go +++ b/rest_management_api_client/identity/get_identity_failed_service_requests_responses.go @@ -65,7 +65,6 @@ func (o *GetIdentityFailedServiceRequestsReader) ReadResponse(response runtime.C 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()) } @@ -76,25 +75,24 @@ func NewGetIdentityFailedServiceRequestsOK() *GetIdentityFailedServiceRequestsOK return &GetIdentityFailedServiceRequestsOK{} } -/*GetIdentityFailedServiceRequestsOK handles this case with default header values. +/* 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.GetIdentityFailedServiceRequestEnvelope + 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.GetIdentityFailedServiceRequestEnvelope { +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.GetIdentityFailedServiceRequestEnvelope) + o.Payload = new(rest_model.FailedServiceRequestEnvelope) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -109,7 +107,7 @@ func NewGetIdentityFailedServiceRequestsUnauthorized() *GetIdentityFailedService return &GetIdentityFailedServiceRequestsUnauthorized{} } -/*GetIdentityFailedServiceRequestsUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type GetIdentityFailedServiceRequestsUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewGetIdentityFailedServiceRequestsNotFound() *GetIdentityFailedServiceRequ return &GetIdentityFailedServiceRequestsNotFound{} } -/*GetIdentityFailedServiceRequestsNotFound handles this case with default header values. +/* GetIdentityFailedServiceRequestsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type GetIdentityFailedServiceRequestsNotFound struct { 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 } diff --git a/rest_client/identity/get_identity_policy_advice_parameters.go b/rest_management_api_client/identity/get_identity_policy_advice_parameters.go similarity index 80% rename from rest_client/identity/get_identity_policy_advice_parameters.go rename to rest_management_api_client/identity/get_identity_policy_advice_parameters.go index e5e654e4d..c42109eea 100644 --- a/rest_client/identity/get_identity_policy_advice_parameters.go +++ b/rest_management_api_client/identity/get_identity_policy_advice_parameters.go @@ -40,58 +40,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetIdentityPolicyAdviceParams creates a new GetIdentityPolicyAdviceParams object -// with the default values initialized. +// 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 { - var () return &GetIdentityPolicyAdviceParams{ - timeout: cr.DefaultTimeout, } } // NewGetIdentityPolicyAdviceParamsWithTimeout creates a new GetIdentityPolicyAdviceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetIdentityPolicyAdviceParamsWithTimeout(timeout time.Duration) *GetIdentityPolicyAdviceParams { - var () return &GetIdentityPolicyAdviceParams{ - timeout: timeout, } } // NewGetIdentityPolicyAdviceParamsWithContext creates a new GetIdentityPolicyAdviceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetIdentityPolicyAdviceParamsWithContext(ctx context.Context) *GetIdentityPolicyAdviceParams { - var () return &GetIdentityPolicyAdviceParams{ - Context: ctx, } } // NewGetIdentityPolicyAdviceParamsWithHTTPClient creates a new GetIdentityPolicyAdviceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetIdentityPolicyAdviceParamsWithHTTPClient(client *http.Client) *GetIdentityPolicyAdviceParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*ServiceID - The id of a service + /* ServiceID. + + The id of a service */ ServiceID string @@ -100,6 +100,21 @@ type GetIdentityPolicyAdviceParams struct { 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) diff --git a/rest_client/identity/get_identity_policy_advice_responses.go b/rest_management_api_client/identity/get_identity_policy_advice_responses.go similarity index 94% rename from rest_client/identity/get_identity_policy_advice_responses.go rename to rest_management_api_client/identity/get_identity_policy_advice_responses.go index 9b6dd4a73..e61d05ba9 100644 --- a/rest_client/identity/get_identity_policy_advice_responses.go +++ b/rest_management_api_client/identity/get_identity_policy_advice_responses.go @@ -65,7 +65,6 @@ func (o *GetIdentityPolicyAdviceReader) ReadResponse(response runtime.ClientResp 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()) } @@ -76,7 +75,7 @@ func NewGetIdentityPolicyAdviceOK() *GetIdentityPolicyAdviceOK { return &GetIdentityPolicyAdviceOK{} } -/*GetIdentityPolicyAdviceOK handles this case with default header values. +/* GetIdentityPolicyAdviceOK describes a response with status code 200, with default header values. Returns the document that represents the policy advice */ @@ -87,7 +86,6 @@ type GetIdentityPolicyAdviceOK struct { 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 } @@ -109,7 +107,7 @@ func NewGetIdentityPolicyAdviceUnauthorized() *GetIdentityPolicyAdviceUnauthoriz return &GetIdentityPolicyAdviceUnauthorized{} } -/*GetIdentityPolicyAdviceUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type GetIdentityPolicyAdviceUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewGetIdentityPolicyAdviceNotFound() *GetIdentityPolicyAdviceNotFound { return &GetIdentityPolicyAdviceNotFound{} } -/*GetIdentityPolicyAdviceNotFound handles this case with default header values. +/* GetIdentityPolicyAdviceNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type GetIdentityPolicyAdviceNotFound struct { 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 } diff --git a/rest_client/identity/get_identity_posture_data_parameters.go b/rest_management_api_client/identity/get_identity_posture_data_parameters.go similarity index 78% rename from rest_client/identity/get_identity_posture_data_parameters.go rename to rest_management_api_client/identity/get_identity_posture_data_parameters.go index a5c8b5a50..7cf22e8f0 100644 --- a/rest_client/identity/get_identity_posture_data_parameters.go +++ b/rest_management_api_client/identity/get_identity_posture_data_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetIdentityPostureDataParams creates a new GetIdentityPostureDataParams object -// with the default values initialized. +// 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 { - var () return &GetIdentityPostureDataParams{ - timeout: cr.DefaultTimeout, } } // NewGetIdentityPostureDataParamsWithTimeout creates a new GetIdentityPostureDataParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetIdentityPostureDataParamsWithTimeout(timeout time.Duration) *GetIdentityPostureDataParams { - var () return &GetIdentityPostureDataParams{ - timeout: timeout, } } // NewGetIdentityPostureDataParamsWithContext creates a new GetIdentityPostureDataParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetIdentityPostureDataParamsWithContext(ctx context.Context) *GetIdentityPostureDataParams { - var () return &GetIdentityPostureDataParams{ - Context: ctx, } } // NewGetIdentityPostureDataParamsWithHTTPClient creates a new GetIdentityPostureDataParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetIdentityPostureDataParamsWithHTTPClient(client *http.Client) *GetIdentityPostureDataParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type GetIdentityPostureDataParams struct { 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) diff --git a/rest_client/identity/get_identity_posture_data_responses.go b/rest_management_api_client/identity/get_identity_posture_data_responses.go similarity index 91% rename from rest_client/identity/get_identity_posture_data_responses.go rename to rest_management_api_client/identity/get_identity_posture_data_responses.go index efed8b741..17ef39f76 100644 --- a/rest_client/identity/get_identity_posture_data_responses.go +++ b/rest_management_api_client/identity/get_identity_posture_data_responses.go @@ -65,7 +65,6 @@ func (o *GetIdentityPostureDataReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,25 +75,24 @@ func NewGetIdentityPostureDataOK() *GetIdentityPostureDataOK { return &GetIdentityPostureDataOK{} } -/*GetIdentityPostureDataOK handles this case with default header values. +/* 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.GetIdentityPostureDataEnvelope + 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.GetIdentityPostureDataEnvelope { +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.GetIdentityPostureDataEnvelope) + o.Payload = new(rest_model.PostureDataEnvelope) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -109,7 +107,7 @@ func NewGetIdentityPostureDataUnauthorized() *GetIdentityPostureDataUnauthorized return &GetIdentityPostureDataUnauthorized{} } -/*GetIdentityPostureDataUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type GetIdentityPostureDataUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewGetIdentityPostureDataNotFound() *GetIdentityPostureDataNotFound { return &GetIdentityPostureDataNotFound{} } -/*GetIdentityPostureDataNotFound handles this case with default header values. +/* GetIdentityPostureDataNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type GetIdentityPostureDataNotFound struct { 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 } diff --git a/rest_client/identity/identity_client.go b/rest_management_api_client/identity/identity_client.go similarity index 82% rename from rest_client/identity/identity_client.go rename to rest_management_api_client/identity/identity_client.go index 3ae130a5e..3b2620791 100644 --- a/rest_client/identity/identity_client.go +++ b/rest_management_api_client/identity/identity_client.go @@ -49,45 +49,48 @@ type Client struct { 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) (*AssociateIdentitysServiceConfigsOK, error) + AssociateIdentitysServiceConfigs(params *AssociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssociateIdentitysServiceConfigsOK, error) - CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*CreateIdentityCreated, error) + CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIdentityCreated, error) - DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteIdentityOK, error) + DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIdentityOK, error) - DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*DetailIdentityOK, error) + DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityOK, error) - DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailIdentityTypeOK, error) + DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityTypeOK, error) - DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*DisassociateIdentitysServiceConfigsOK, error) + DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisassociateIdentitysServiceConfigsOK, error) - GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityFailedServiceRequestsOK, error) + GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityFailedServiceRequestsOK, error) - GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityPolicyAdviceOK, error) + GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPolicyAdviceOK, error) - GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityPostureDataOK, error) + GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPostureDataOK, error) - ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentitiesOK, error) + ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitiesOK, error) - ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityEdgeRoutersOK, error) + ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityEdgeRoutersOK, error) - ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityServicePoliciesOK, error) + ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicePoliciesOK, error) - ListIdentityServices(params *ListIdentityServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityServicesOK, error) + ListIdentityServices(params *ListIdentityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicesOK, error) - ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityTypesOK, error) + ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityTypesOK, error) - ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentitysEdgeRouterPoliciesOK, error) + ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysEdgeRouterPoliciesOK, error) - ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentitysServiceConfigsOK, error) + ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysServiceConfigsOK, error) - PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*PatchIdentityOK, error) + PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchIdentityOK, error) - RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter) (*RemoveIdentityMfaOK, error) + RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveIdentityMfaOK, error) - UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateIdentityOK, error) + UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityOK, error) SetTransport(transport runtime.ClientTransport) } @@ -97,13 +100,12 @@ type ClientService interface { Associate service configs to a specific identity */ -func (a *Client) AssociateIdentitysServiceConfigs(params *AssociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*AssociateIdentitysServiceConfigsOK, error) { +func (a *Client) AssociateIdentitysServiceConfigs(params *AssociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssociateIdentitysServiceConfigsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAssociateIdentitysServiceConfigsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "associateIdentitysServiceConfigs", Method: "POST", PathPattern: "/identities/{id}/service-configs", @@ -115,7 +117,12 @@ func (a *Client) AssociateIdentitysServiceConfigs(params *AssociateIdentitysServ 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 } @@ -134,13 +141,12 @@ func (a *Client) AssociateIdentitysServiceConfigs(params *AssociateIdentitysServ Create an identity resource. Requires admin access. */ -func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*CreateIdentityCreated, error) { +func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIdentityCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createIdentity", Method: "POST", PathPattern: "/identities", @@ -152,7 +158,12 @@ func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.C 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 } @@ -171,13 +182,12 @@ func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.C Delete an identity by id. Requires admin access. */ -func (a *Client) DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteIdentityOK, error) { +func (a *Client) DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIdentityOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteIdentity", Method: "DELETE", PathPattern: "/identities/{id}", @@ -189,7 +199,12 @@ func (a *Client) DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.C 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 } @@ -208,13 +223,12 @@ func (a *Client) DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.C Retrieves a single identity by id. Requires admin access. */ -func (a *Client) DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*DetailIdentityOK, error) { +func (a *Client) DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailIdentity", Method: "GET", PathPattern: "/identities/{id}", @@ -226,7 +240,12 @@ func (a *Client) DetailIdentity(params *DetailIdentityParams, authInfo runtime.C 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 } @@ -245,13 +264,12 @@ func (a *Client) DetailIdentity(params *DetailIdentityParams, authInfo runtime.C Retrieves a single identity type by id. Requires admin access. */ -func (a *Client) DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailIdentityTypeOK, error) { +func (a *Client) DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailIdentityTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailIdentityType", Method: "GET", PathPattern: "/identity-types/{id}", @@ -263,7 +281,12 @@ func (a *Client) DetailIdentityType(params *DetailIdentityTypeParams, authInfo r 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 } @@ -282,13 +305,12 @@ func (a *Client) DetailIdentityType(params *DetailIdentityTypeParams, authInfo r Remove service configs from a specific identity */ -func (a *Client) DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*DisassociateIdentitysServiceConfigsOK, error) { +func (a *Client) DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisassociateIdentitysServiceConfigsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDisassociateIdentitysServiceConfigsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "disassociateIdentitysServiceConfigs", Method: "DELETE", PathPattern: "/identities/{id}/service-configs", @@ -300,7 +322,12 @@ func (a *Client) DisassociateIdentitysServiceConfigs(params *DisassociateIdentit 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 } @@ -322,13 +349,12 @@ every policy that was verified against and every failed check in each policy. Ea the historical posture data and posture check configuration. */ -func (a *Client) GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityFailedServiceRequestsOK, error) { +func (a *Client) GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityFailedServiceRequestsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetIdentityFailedServiceRequestsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getIdentityFailedServiceRequests", Method: "GET", PathPattern: "/identities/{id}/failed-service-requests", @@ -340,7 +366,12 @@ func (a *Client) GetIdentityFailedServiceRequests(params *GetIdentityFailedServi 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 } @@ -363,13 +394,12 @@ to check if the identity and service have access to common edge routers so that Will also check if at least one edge router is on-line. Requires admin access. */ -func (a *Client) GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityPolicyAdviceOK, error) { +func (a *Client) GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPolicyAdviceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetIdentityPolicyAdviceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getIdentityPolicyAdvice", Method: "GET", PathPattern: "/identities/{id}/policy-advice/{serviceId}", @@ -381,7 +411,12 @@ func (a *Client) GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, 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 } @@ -402,13 +437,12 @@ func (a *Client) GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, This data should be considered volatile. */ -func (a *Client) GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter) (*GetIdentityPostureDataOK, error) { +func (a *Client) GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPostureDataOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetIdentityPostureDataParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getIdentityPostureData", Method: "GET", PathPattern: "/identities/{id}/posture-data", @@ -420,7 +454,12 @@ func (a *Client) GetIdentityPostureData(params *GetIdentityPostureDataParams, au 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 } @@ -440,13 +479,12 @@ func (a *Client) GetIdentityPostureData(params *GetIdentityPostureDataParams, au Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentitiesOK, error) { +func (a *Client) ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentitiesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentities", Method: "GET", PathPattern: "/identities", @@ -458,7 +496,12 @@ func (a *Client) ListIdentities(params *ListIdentitiesParams, authInfo runtime.C 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 } @@ -478,13 +521,12 @@ func (a *Client) ListIdentities(params *ListIdentitiesParams, authInfo runtime.C 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) (*ListIdentityEdgeRoutersOK, error) { +func (a *Client) ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentityEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentityEdgeRouters", Method: "GET", PathPattern: "/identities/{id}/edge-routers", @@ -496,7 +538,12 @@ func (a *Client) ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, 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 } @@ -515,13 +562,12 @@ func (a *Client) ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, Retrieves a list of service policies that apply to the specified identity. */ -func (a *Client) ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityServicePoliciesOK, error) { +func (a *Client) ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicePoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentityServicePoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentityServicePolicies", Method: "GET", PathPattern: "/identities/{id}/service-policies", @@ -533,7 +579,12 @@ func (a *Client) ListIdentityServicePolicies(params *ListIdentityServicePolicies 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 } @@ -553,13 +604,12 @@ func (a *Client) ListIdentityServicePolicies(params *ListIdentityServicePolicies 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) (*ListIdentityServicesOK, error) { +func (a *Client) ListIdentityServices(params *ListIdentityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentityServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentityServices", Method: "GET", PathPattern: "/identities/{id}/services", @@ -571,7 +621,12 @@ func (a *Client) ListIdentityServices(params *ListIdentityServicesParams, authIn 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 } @@ -591,13 +646,12 @@ func (a *Client) ListIdentityServices(params *ListIdentityServicesParams, authIn Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityTypesOK, error) { +func (a *Client) ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityTypesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentityTypesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentityTypes", Method: "GET", PathPattern: "/identity-types", @@ -609,7 +663,12 @@ func (a *Client) ListIdentityTypes(params *ListIdentityTypesParams, authInfo run 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 } @@ -624,17 +683,16 @@ func (a *Client) ListIdentityTypes(params *ListIdentityTypesParams, authInfo run } /* - ListIdentitysEdgeRouterPolicies lists the edge router policies that affect an idenitty + 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) (*ListIdentitysEdgeRouterPoliciesOK, error) { +func (a *Client) ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentitysEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentitysEdgeRouterPolicies", Method: "GET", PathPattern: "/identities/{id}/edge-router-policies", @@ -646,7 +704,12 @@ func (a *Client) ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouter 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 } @@ -665,13 +728,12 @@ func (a *Client) ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouter Retrieves a list of service configs associated to a specific identity */ -func (a *Client) ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentitysServiceConfigsOK, error) { +func (a *Client) ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysServiceConfigsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentitysServiceConfigsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentitysServiceConfigs", Method: "GET", PathPattern: "/identities/{id}/service-configs", @@ -683,7 +745,12 @@ func (a *Client) ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigs 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 } @@ -702,13 +769,12 @@ func (a *Client) ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigs Update the supplied fields on an identity. Requires admin access. */ -func (a *Client) PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*PatchIdentityOK, error) { +func (a *Client) PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchIdentityOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchIdentity", Method: "PATCH", PathPattern: "/identities/{id}", @@ -720,7 +786,12 @@ func (a *Client) PatchIdentity(params *PatchIdentityParams, authInfo runtime.Cli 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 } @@ -740,13 +811,12 @@ func (a *Client) PatchIdentity(params *PatchIdentityParams, authInfo runtime.Cli Allows an admin to remove MFA enrollment from a specific identity. Requires admin. */ -func (a *Client) RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter) (*RemoveIdentityMfaOK, error) { +func (a *Client) RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveIdentityMfaOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveIdentityMfaParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "removeIdentityMfa", Method: "DELETE", PathPattern: "/identities/{id}/mfa", @@ -758,7 +828,12 @@ func (a *Client) RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo run 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 } @@ -777,13 +852,12 @@ func (a *Client) RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo run Update all fields on an identity by id. Requires admin access. */ -func (a *Client) UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateIdentityOK, error) { +func (a *Client) UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateIdentityParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateIdentity", Method: "PUT", PathPattern: "/identities/{id}", @@ -795,7 +869,12 @@ func (a *Client) UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.C 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 } diff --git a/rest_client/identity/list_identities_parameters.go b/rest_management_api_client/identity/list_identities_parameters.go similarity index 77% rename from rest_client/identity/list_identities_parameters.go rename to rest_management_api_client/identity/list_identities_parameters.go index a7ceb48bc..9a5ccd595 100644 --- a/rest_client/identity/list_identities_parameters.go +++ b/rest_management_api_client/identity/list_identities_parameters.go @@ -41,59 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListIdentitiesParams creates a new ListIdentitiesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentitiesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentitiesParamsWithTimeout creates a new ListIdentitiesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentitiesParamsWithTimeout(timeout time.Duration) *ListIdentitiesParams { - var () return &ListIdentitiesParams{ - timeout: timeout, } } // NewListIdentitiesParamsWithContext creates a new ListIdentitiesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentitiesParamsWithContext(ctx context.Context) *ListIdentitiesParams { - var () return &ListIdentitiesParams{ - Context: ctx, } } // NewListIdentitiesParamsWithHTTPClient creates a new ListIdentitiesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentitiesParamsWithHTTPClient(client *http.Client) *ListIdentitiesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 - /*RoleFilter*/ + + // RoleFilter. RoleFilter []string - /*RoleSemantic*/ + + // RoleSemantic. RoleSemantic *string timeout time.Duration @@ -101,6 +104,21 @@ type ListIdentitiesParams struct { 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) @@ -201,72 +219,79 @@ func (o *ListIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfm // 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 } } - } - valuesRoleFilter := o.RoleFilter + if o.RoleFilter != nil { - joinedRoleFilter := swag.JoinByFormat(valuesRoleFilter, "multi") - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err + // 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 { @@ -274,3 +299,20 @@ func (o *ListIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfm } 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_client/identity/list_identities_responses.go b/rest_management_api_client/identity/list_identities_responses.go similarity index 95% rename from rest_client/identity/list_identities_responses.go rename to rest_management_api_client/identity/list_identities_responses.go index 4b816914c..a52d6a961 100644 --- a/rest_client/identity/list_identities_responses.go +++ b/rest_management_api_client/identity/list_identities_responses.go @@ -59,7 +59,6 @@ func (o *ListIdentitiesReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -70,7 +69,7 @@ func NewListIdentitiesOK() *ListIdentitiesOK { return &ListIdentitiesOK{} } -/*ListIdentitiesOK handles this case with default header values. +/* ListIdentitiesOK describes a response with status code 200, with default header values. A list of identities */ @@ -81,7 +80,6 @@ type ListIdentitiesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListIdentitiesUnauthorized() *ListIdentitiesUnauthorized { return &ListIdentitiesUnauthorized{} } -/*ListIdentitiesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListIdentitiesUnauthorized struct { 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 } diff --git a/rest_client/identity/list_identity_edge_routers_parameters.go b/rest_management_api_client/identity/list_identity_edge_routers_parameters.go similarity index 78% rename from rest_client/identity/list_identity_edge_routers_parameters.go rename to rest_management_api_client/identity/list_identity_edge_routers_parameters.go index 134a783ed..84815fcce 100644 --- a/rest_client/identity/list_identity_edge_routers_parameters.go +++ b/rest_management_api_client/identity/list_identity_edge_routers_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListIdentityEdgeRoutersParams creates a new ListIdentityEdgeRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListIdentityEdgeRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentityEdgeRoutersParamsWithTimeout creates a new ListIdentityEdgeRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentityEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListIdentityEdgeRoutersParams { - var () return &ListIdentityEdgeRoutersParams{ - timeout: timeout, } } // NewListIdentityEdgeRoutersParamsWithContext creates a new ListIdentityEdgeRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentityEdgeRoutersParamsWithContext(ctx context.Context) *ListIdentityEdgeRoutersParams { - var () return &ListIdentityEdgeRoutersParams{ - Context: ctx, } } // NewListIdentityEdgeRoutersParamsWithHTTPClient creates a new ListIdentityEdgeRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentityEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListIdentityEdgeRoutersParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListIdentityEdgeRoutersParams struct { 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) diff --git a/rest_client/identity/list_identity_edge_routers_responses.go b/rest_management_api_client/identity/list_identity_edge_routers_responses.go similarity index 94% rename from rest_client/identity/list_identity_edge_routers_responses.go rename to rest_management_api_client/identity/list_identity_edge_routers_responses.go index 1cf2e52a9..fda89f299 100644 --- a/rest_client/identity/list_identity_edge_routers_responses.go +++ b/rest_management_api_client/identity/list_identity_edge_routers_responses.go @@ -65,7 +65,6 @@ func (o *ListIdentityEdgeRoutersReader) ReadResponse(response runtime.ClientResp 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()) } @@ -76,7 +75,7 @@ func NewListIdentityEdgeRoutersOK() *ListIdentityEdgeRoutersOK { return &ListIdentityEdgeRoutersOK{} } -/*ListIdentityEdgeRoutersOK handles this case with default header values. +/* ListIdentityEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -87,7 +86,6 @@ type ListIdentityEdgeRoutersOK struct { 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 } @@ -109,7 +107,7 @@ func NewListIdentityEdgeRoutersUnauthorized() *ListIdentityEdgeRoutersUnauthoriz return &ListIdentityEdgeRoutersUnauthorized{} } -/*ListIdentityEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListIdentityEdgeRoutersUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListIdentityEdgeRoutersNotFound() *ListIdentityEdgeRoutersNotFound { return &ListIdentityEdgeRoutersNotFound{} } -/*ListIdentityEdgeRoutersNotFound handles this case with default header values. +/* ListIdentityEdgeRoutersNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListIdentityEdgeRoutersNotFound struct { 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 } diff --git a/rest_client/identity/list_identity_service_policies_parameters.go b/rest_management_api_client/identity/list_identity_service_policies_parameters.go similarity index 78% rename from rest_client/identity/list_identity_service_policies_parameters.go rename to rest_management_api_client/identity/list_identity_service_policies_parameters.go index c8a798c32..9dd19c794 100644 --- a/rest_client/identity/list_identity_service_policies_parameters.go +++ b/rest_management_api_client/identity/list_identity_service_policies_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListIdentityServicePoliciesParams creates a new ListIdentityServicePoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentityServicePoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentityServicePoliciesParamsWithTimeout creates a new ListIdentityServicePoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentityServicePoliciesParamsWithTimeout(timeout time.Duration) *ListIdentityServicePoliciesParams { - var () return &ListIdentityServicePoliciesParams{ - timeout: timeout, } } // NewListIdentityServicePoliciesParamsWithContext creates a new ListIdentityServicePoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentityServicePoliciesParamsWithContext(ctx context.Context) *ListIdentityServicePoliciesParams { - var () return &ListIdentityServicePoliciesParams{ - Context: ctx, } } // NewListIdentityServicePoliciesParamsWithHTTPClient creates a new ListIdentityServicePoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentityServicePoliciesParamsWithHTTPClient(client *http.Client) *ListIdentityServicePoliciesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListIdentityServicePoliciesParams struct { 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) diff --git a/rest_client/identity/list_identity_service_policies_responses.go b/rest_management_api_client/identity/list_identity_service_policies_responses.go similarity index 94% rename from rest_client/identity/list_identity_service_policies_responses.go rename to rest_management_api_client/identity/list_identity_service_policies_responses.go index ab4c655cf..eb796b692 100644 --- a/rest_client/identity/list_identity_service_policies_responses.go +++ b/rest_management_api_client/identity/list_identity_service_policies_responses.go @@ -65,7 +65,6 @@ func (o *ListIdentityServicePoliciesReader) ReadResponse(response runtime.Client 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()) } @@ -76,7 +75,7 @@ func NewListIdentityServicePoliciesOK() *ListIdentityServicePoliciesOK { return &ListIdentityServicePoliciesOK{} } -/*ListIdentityServicePoliciesOK handles this case with default header values. +/* ListIdentityServicePoliciesOK describes a response with status code 200, with default header values. A list of service policies */ @@ -87,7 +86,6 @@ type ListIdentityServicePoliciesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListIdentityServicePoliciesUnauthorized() *ListIdentityServicePoliciesUn return &ListIdentityServicePoliciesUnauthorized{} } -/*ListIdentityServicePoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListIdentityServicePoliciesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListIdentityServicePoliciesNotFound() *ListIdentityServicePoliciesNotFou return &ListIdentityServicePoliciesNotFound{} } -/*ListIdentityServicePoliciesNotFound handles this case with default header values. +/* ListIdentityServicePoliciesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListIdentityServicePoliciesNotFound struct { 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 } diff --git a/rest_client/identity/list_identity_services_parameters.go b/rest_management_api_client/identity/list_identity_services_parameters.go similarity index 78% rename from rest_client/identity/list_identity_services_parameters.go rename to rest_management_api_client/identity/list_identity_services_parameters.go index 3067e9fc4..be121c0f7 100644 --- a/rest_client/identity/list_identity_services_parameters.go +++ b/rest_management_api_client/identity/list_identity_services_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListIdentityServicesParams creates a new ListIdentityServicesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentityServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentityServicesParamsWithTimeout creates a new ListIdentityServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentityServicesParamsWithTimeout(timeout time.Duration) *ListIdentityServicesParams { - var () return &ListIdentityServicesParams{ - timeout: timeout, } } // NewListIdentityServicesParamsWithContext creates a new ListIdentityServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentityServicesParamsWithContext(ctx context.Context) *ListIdentityServicesParams { - var () return &ListIdentityServicesParams{ - Context: ctx, } } // NewListIdentityServicesParamsWithHTTPClient creates a new ListIdentityServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentityServicesParamsWithHTTPClient(client *http.Client) *ListIdentityServicesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListIdentityServicesParams struct { 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) diff --git a/rest_client/identity/list_identity_services_responses.go b/rest_management_api_client/identity/list_identity_services_responses.go similarity index 94% rename from rest_client/identity/list_identity_services_responses.go rename to rest_management_api_client/identity/list_identity_services_responses.go index f7d57676e..f7b711714 100644 --- a/rest_client/identity/list_identity_services_responses.go +++ b/rest_management_api_client/identity/list_identity_services_responses.go @@ -65,7 +65,6 @@ func (o *ListIdentityServicesReader) ReadResponse(response runtime.ClientRespons 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()) } @@ -76,7 +75,7 @@ func NewListIdentityServicesOK() *ListIdentityServicesOK { return &ListIdentityServicesOK{} } -/*ListIdentityServicesOK handles this case with default header values. +/* ListIdentityServicesOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -87,7 +86,6 @@ type ListIdentityServicesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListIdentityServicesUnauthorized() *ListIdentityServicesUnauthorized { return &ListIdentityServicesUnauthorized{} } -/*ListIdentityServicesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListIdentityServicesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListIdentityServicesNotFound() *ListIdentityServicesNotFound { return &ListIdentityServicesNotFound{} } -/*ListIdentityServicesNotFound handles this case with default header values. +/* ListIdentityServicesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListIdentityServicesNotFound struct { 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 } diff --git a/rest_client/identity/list_identity_types_parameters.go b/rest_management_api_client/identity/list_identity_types_parameters.go similarity index 83% rename from rest_client/identity/list_identity_types_parameters.go rename to rest_management_api_client/identity/list_identity_types_parameters.go index 825f62909..63d30d30a 100644 --- a/rest_client/identity/list_identity_types_parameters.go +++ b/rest_management_api_client/identity/list_identity_types_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListIdentityTypesParams creates a new ListIdentityTypesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentityTypesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentityTypesParamsWithTimeout creates a new ListIdentityTypesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentityTypesParamsWithTimeout(timeout time.Duration) *ListIdentityTypesParams { - var () return &ListIdentityTypesParams{ - timeout: timeout, } } // NewListIdentityTypesParamsWithContext creates a new ListIdentityTypesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentityTypesParamsWithContext(ctx context.Context) *ListIdentityTypesParams { - var () return &ListIdentityTypesParams{ - Context: ctx, } } // NewListIdentityTypesParamsWithHTTPClient creates a new ListIdentityTypesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentityTypesParamsWithHTTPClient(client *http.Client) *ListIdentityTypesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListIdentityTypesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListIdentityTypesParams) WriteToRequest(r runtime.ClientRequest, reg st // 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 { diff --git a/rest_client/identity/list_identity_types_responses.go b/rest_management_api_client/identity/list_identity_types_responses.go similarity index 95% rename from rest_client/identity/list_identity_types_responses.go rename to rest_management_api_client/identity/list_identity_types_responses.go index dae48d844..5b175fd6b 100644 --- a/rest_client/identity/list_identity_types_responses.go +++ b/rest_management_api_client/identity/list_identity_types_responses.go @@ -59,7 +59,6 @@ func (o *ListIdentityTypesReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -70,7 +69,7 @@ func NewListIdentityTypesOK() *ListIdentityTypesOK { return &ListIdentityTypesOK{} } -/*ListIdentityTypesOK handles this case with default header values. +/* ListIdentityTypesOK describes a response with status code 200, with default header values. A list of identity types */ @@ -81,7 +80,6 @@ type ListIdentityTypesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListIdentityTypesUnauthorized() *ListIdentityTypesUnauthorized { return &ListIdentityTypesUnauthorized{} } -/*ListIdentityTypesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListIdentityTypesUnauthorized struct { 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 } diff --git a/rest_client/identity/list_identitys_edge_router_policies_parameters.go b/rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go similarity index 78% rename from rest_client/identity/list_identitys_edge_router_policies_parameters.go rename to rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go index d00b58f2e..5203bd138 100644 --- a/rest_client/identity/list_identitys_edge_router_policies_parameters.go +++ b/rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListIdentitysEdgeRouterPoliciesParams creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentitysEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentitysEdgeRouterPoliciesParamsWithTimeout creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentitysEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListIdentitysEdgeRouterPoliciesParams { - var () return &ListIdentitysEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListIdentitysEdgeRouterPoliciesParamsWithContext creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentitysEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListIdentitysEdgeRouterPoliciesParams { - var () return &ListIdentitysEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListIdentitysEdgeRouterPoliciesParamsWithHTTPClient creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentitysEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListIdentitysEdgeRouterPoliciesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListIdentitysEdgeRouterPoliciesParams struct { 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) diff --git a/rest_client/identity/list_identitys_edge_router_policies_responses.go b/rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go similarity index 94% rename from rest_client/identity/list_identitys_edge_router_policies_responses.go rename to rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go index cecee8386..a9ed4bfda 100644 --- a/rest_client/identity/list_identitys_edge_router_policies_responses.go +++ b/rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go @@ -65,7 +65,6 @@ func (o *ListIdentitysEdgeRouterPoliciesReader) ReadResponse(response runtime.Cl 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()) } @@ -76,7 +75,7 @@ func NewListIdentitysEdgeRouterPoliciesOK() *ListIdentitysEdgeRouterPoliciesOK { return &ListIdentitysEdgeRouterPoliciesOK{} } -/*ListIdentitysEdgeRouterPoliciesOK handles this case with default header values. +/* ListIdentitysEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of edge router policies */ @@ -87,7 +86,6 @@ type ListIdentitysEdgeRouterPoliciesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListIdentitysEdgeRouterPoliciesUnauthorized() *ListIdentitysEdgeRouterPo return &ListIdentitysEdgeRouterPoliciesUnauthorized{} } -/*ListIdentitysEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListIdentitysEdgeRouterPoliciesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListIdentitysEdgeRouterPoliciesNotFound() *ListIdentitysEdgeRouterPolici return &ListIdentitysEdgeRouterPoliciesNotFound{} } -/*ListIdentitysEdgeRouterPoliciesNotFound handles this case with default header values. +/* ListIdentitysEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListIdentitysEdgeRouterPoliciesNotFound struct { 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 } diff --git a/rest_client/identity/list_identitys_service_configs_parameters.go b/rest_management_api_client/identity/list_identitys_service_configs_parameters.go similarity index 78% rename from rest_client/identity/list_identitys_service_configs_parameters.go rename to rest_management_api_client/identity/list_identitys_service_configs_parameters.go index a81bdede9..86cc0ec21 100644 --- a/rest_client/identity/list_identitys_service_configs_parameters.go +++ b/rest_management_api_client/identity/list_identitys_service_configs_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListIdentitysServiceConfigsParams creates a new ListIdentitysServiceConfigsParams object -// with the default values initialized. +// 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 { - var () return &ListIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentitysServiceConfigsParamsWithTimeout creates a new ListIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *ListIdentitysServiceConfigsParams { - var () return &ListIdentitysServiceConfigsParams{ - timeout: timeout, } } // NewListIdentitysServiceConfigsParamsWithContext creates a new ListIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentitysServiceConfigsParamsWithContext(ctx context.Context) *ListIdentitysServiceConfigsParams { - var () return &ListIdentitysServiceConfigsParams{ - Context: ctx, } } // NewListIdentitysServiceConfigsParamsWithHTTPClient creates a new ListIdentitysServiceConfigsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *ListIdentitysServiceConfigsParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListIdentitysServiceConfigsParams struct { 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) diff --git a/rest_client/identity/list_identitys_service_configs_responses.go b/rest_management_api_client/identity/list_identitys_service_configs_responses.go similarity index 94% rename from rest_client/identity/list_identitys_service_configs_responses.go rename to rest_management_api_client/identity/list_identitys_service_configs_responses.go index 569389fdf..0e97584da 100644 --- a/rest_client/identity/list_identitys_service_configs_responses.go +++ b/rest_management_api_client/identity/list_identitys_service_configs_responses.go @@ -65,7 +65,6 @@ func (o *ListIdentitysServiceConfigsReader) ReadResponse(response runtime.Client 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()) } @@ -76,7 +75,7 @@ func NewListIdentitysServiceConfigsOK() *ListIdentitysServiceConfigsOK { return &ListIdentitysServiceConfigsOK{} } -/*ListIdentitysServiceConfigsOK handles this case with default header values. +/* ListIdentitysServiceConfigsOK describes a response with status code 200, with default header values. A list of service configs */ @@ -87,7 +86,6 @@ type ListIdentitysServiceConfigsOK struct { 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 } @@ -109,7 +107,7 @@ func NewListIdentitysServiceConfigsUnauthorized() *ListIdentitysServiceConfigsUn return &ListIdentitysServiceConfigsUnauthorized{} } -/*ListIdentitysServiceConfigsUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListIdentitysServiceConfigsUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListIdentitysServiceConfigsNotFound() *ListIdentitysServiceConfigsNotFou return &ListIdentitysServiceConfigsNotFound{} } -/*ListIdentitysServiceConfigsNotFound handles this case with default header values. +/* ListIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListIdentitysServiceConfigsNotFound struct { 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 } diff --git a/rest_client/identity/patch_identity_parameters.go b/rest_management_api_client/identity/patch_identity_parameters.go similarity index 79% rename from rest_client/identity/patch_identity_parameters.go rename to rest_management_api_client/identity/patch_identity_parameters.go index b0a9bd9dd..fc9b9440c 100644 --- a/rest_client/identity/patch_identity_parameters.go +++ b/rest_management_api_client/identity/patch_identity_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchIdentityParams creates a new PatchIdentityParams object -// with the default values initialized. +// 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 { - var () return &PatchIdentityParams{ - timeout: cr.DefaultTimeout, } } // NewPatchIdentityParamsWithTimeout creates a new PatchIdentityParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchIdentityParamsWithTimeout(timeout time.Duration) *PatchIdentityParams { - var () return &PatchIdentityParams{ - timeout: timeout, } } // NewPatchIdentityParamsWithContext creates a new PatchIdentityParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchIdentityParamsWithContext(ctx context.Context) *PatchIdentityParams { - var () return &PatchIdentityParams{ - Context: ctx, } } // NewPatchIdentityParamsWithHTTPClient creates a new PatchIdentityParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchIdentityParamsWithHTTPClient(client *http.Client) *PatchIdentityParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Identity - An identity patch object + /* Identity. + + An identity patch object */ Identity *rest_model.IdentityPatch @@ -102,6 +102,21 @@ type PatchIdentityParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt 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 diff --git a/rest_client/identity/patch_identity_responses.go b/rest_management_api_client/identity/patch_identity_responses.go similarity index 94% rename from rest_client/identity/patch_identity_responses.go rename to rest_management_api_client/identity/patch_identity_responses.go index 74b317a08..1e60e92b9 100644 --- a/rest_client/identity/patch_identity_responses.go +++ b/rest_management_api_client/identity/patch_identity_responses.go @@ -71,7 +71,6 @@ func (o *PatchIdentityReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -82,7 +81,7 @@ func NewPatchIdentityOK() *PatchIdentityOK { return &PatchIdentityOK{} } -/*PatchIdentityOK handles this case with default header values. +/* PatchIdentityOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchIdentityOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchIdentityBadRequest() *PatchIdentityBadRequest { return &PatchIdentityBadRequest{} } -/*PatchIdentityBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchIdentityBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchIdentityUnauthorized() *PatchIdentityUnauthorized { return &PatchIdentityUnauthorized{} } -/*PatchIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchIdentityUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchIdentityNotFound() *PatchIdentityNotFound { return &PatchIdentityNotFound{} } -/*PatchIdentityNotFound handles this case with default header values. +/* PatchIdentityNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchIdentityNotFound struct { 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 } diff --git a/rest_client/identity/remove_identity_mfa_parameters.go b/rest_management_api_client/identity/remove_identity_mfa_parameters.go similarity index 78% rename from rest_client/identity/remove_identity_mfa_parameters.go rename to rest_management_api_client/identity/remove_identity_mfa_parameters.go index a3ad35081..e24d90ddc 100644 --- a/rest_client/identity/remove_identity_mfa_parameters.go +++ b/rest_management_api_client/identity/remove_identity_mfa_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveIdentityMfaParams creates a new RemoveIdentityMfaParams object -// with the default values initialized. +// 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 { - var () return &RemoveIdentityMfaParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveIdentityMfaParamsWithTimeout creates a new RemoveIdentityMfaParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveIdentityMfaParamsWithTimeout(timeout time.Duration) *RemoveIdentityMfaParams { - var () return &RemoveIdentityMfaParams{ - timeout: timeout, } } // NewRemoveIdentityMfaParamsWithContext creates a new RemoveIdentityMfaParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveIdentityMfaParamsWithContext(ctx context.Context) *RemoveIdentityMfaParams { - var () return &RemoveIdentityMfaParams{ - Context: ctx, } } // NewRemoveIdentityMfaParamsWithHTTPClient creates a new RemoveIdentityMfaParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveIdentityMfaParamsWithHTTPClient(client *http.Client) *RemoveIdentityMfaParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type RemoveIdentityMfaParams struct { 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) diff --git a/rest_client/identity/remove_identity_mfa_responses.go b/rest_management_api_client/identity/remove_identity_mfa_responses.go similarity index 94% rename from rest_client/identity/remove_identity_mfa_responses.go rename to rest_management_api_client/identity/remove_identity_mfa_responses.go index 35772bfd2..a0d4eecd8 100644 --- a/rest_client/identity/remove_identity_mfa_responses.go +++ b/rest_management_api_client/identity/remove_identity_mfa_responses.go @@ -65,7 +65,6 @@ func (o *RemoveIdentityMfaReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewRemoveIdentityMfaOK() *RemoveIdentityMfaOK { return &RemoveIdentityMfaOK{} } -/*RemoveIdentityMfaOK handles this case with default header values. +/* RemoveIdentityMfaOK describes a response with status code 200, with default header values. Base empty response */ @@ -87,7 +86,6 @@ type RemoveIdentityMfaOK struct { 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 } @@ -109,7 +107,7 @@ func NewRemoveIdentityMfaUnauthorized() *RemoveIdentityMfaUnauthorized { return &RemoveIdentityMfaUnauthorized{} } -/*RemoveIdentityMfaUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type RemoveIdentityMfaUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewRemoveIdentityMfaNotFound() *RemoveIdentityMfaNotFound { return &RemoveIdentityMfaNotFound{} } -/*RemoveIdentityMfaNotFound handles this case with default header values. +/* RemoveIdentityMfaNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type RemoveIdentityMfaNotFound struct { 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 } diff --git a/rest_client/identity/update_identity_parameters.go b/rest_management_api_client/identity/update_identity_parameters.go similarity index 79% rename from rest_client/identity/update_identity_parameters.go rename to rest_management_api_client/identity/update_identity_parameters.go index a5779c0c2..cb2b15dfd 100644 --- a/rest_client/identity/update_identity_parameters.go +++ b/rest_management_api_client/identity/update_identity_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateIdentityParams creates a new UpdateIdentityParams object -// with the default values initialized. +// 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 { - var () return &UpdateIdentityParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateIdentityParamsWithTimeout creates a new UpdateIdentityParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateIdentityParamsWithTimeout(timeout time.Duration) *UpdateIdentityParams { - var () return &UpdateIdentityParams{ - timeout: timeout, } } // NewUpdateIdentityParamsWithContext creates a new UpdateIdentityParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateIdentityParamsWithContext(ctx context.Context) *UpdateIdentityParams { - var () return &UpdateIdentityParams{ - Context: ctx, } } // NewUpdateIdentityParamsWithHTTPClient creates a new UpdateIdentityParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateIdentityParamsWithHTTPClient(client *http.Client) *UpdateIdentityParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Identity - An identity update object + /* Identity. + + An identity update object */ Identity *rest_model.IdentityUpdate @@ -102,6 +102,21 @@ type UpdateIdentityParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfm 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 diff --git a/rest_client/identity/update_identity_responses.go b/rest_management_api_client/identity/update_identity_responses.go similarity index 94% rename from rest_client/identity/update_identity_responses.go rename to rest_management_api_client/identity/update_identity_responses.go index e0ba89019..0a108204c 100644 --- a/rest_client/identity/update_identity_responses.go +++ b/rest_management_api_client/identity/update_identity_responses.go @@ -71,7 +71,6 @@ func (o *UpdateIdentityReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -82,7 +81,7 @@ func NewUpdateIdentityOK() *UpdateIdentityOK { return &UpdateIdentityOK{} } -/*UpdateIdentityOK handles this case with default header values. +/* UpdateIdentityOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateIdentityOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateIdentityBadRequest() *UpdateIdentityBadRequest { return &UpdateIdentityBadRequest{} } -/*UpdateIdentityBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateIdentityBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateIdentityUnauthorized() *UpdateIdentityUnauthorized { return &UpdateIdentityUnauthorized{} } -/*UpdateIdentityUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateIdentityUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateIdentityNotFound() *UpdateIdentityNotFound { return &UpdateIdentityNotFound{} } -/*UpdateIdentityNotFound handles this case with default header values. +/* UpdateIdentityNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateIdentityNotFound struct { 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 } diff --git a/rest_management_api_client/informational/detail_spec_body_parameters.go b/rest_management_api_client/informational/detail_spec_body_parameters.go new file mode 100644 index 000000000..a768602e0 --- /dev/null +++ b/rest_management_api_client/informational/detail_spec_body_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d75a9dea5 --- /dev/null +++ b/rest_management_api_client/informational/detail_spec_body_responses.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1d39ca6c4 --- /dev/null +++ b/rest_management_api_client/informational/detail_spec_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..fef793331 --- /dev/null +++ b/rest_management_api_client/informational/detail_spec_responses.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/informational/informational_client.go b/rest_management_api_client/informational/informational_client.go similarity index 77% rename from rest_client/informational/informational_client.go rename to rest_management_api_client/informational/informational_client.go index 48461152f..4e5b318cb 100644 --- a/rest_client/informational/informational_client.go +++ b/rest_management_api_client/informational/informational_client.go @@ -49,21 +49,22 @@ type Client struct { 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) (*DetailSpecOK, error) + DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) - DetailSpecBody(params *DetailSpecBodyParams) (*DetailSpecBodyOK, error) + DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) - ListProtocols(params *ListProtocolsParams) (*ListProtocolsOK, error) + ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) - ListRoot(params *ListRootParams) (*ListRootOK, error) + ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) - ListSpecs(params *ListSpecsParams) (*ListSpecsOK, error) + ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSummaryOK, error) - ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter) (*ListSummaryOK, error) - - ListVersion(params *ListVersionParams) (*ListVersionOK, error) + ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) SetTransport(transport runtime.ClientTransport) } @@ -73,13 +74,12 @@ type ClientService interface { Returns single spec resource embedded within the controller for consumption/documentation/code geneartion */ -func (a *Client) DetailSpec(params *DetailSpecParams) (*DetailSpecOK, error) { +func (a *Client) DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailSpecParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailSpec", Method: "GET", PathPattern: "/specs/{id}", @@ -90,7 +90,12 @@ func (a *Client) DetailSpec(params *DetailSpecParams) (*DetailSpecOK, error) { 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 } @@ -109,13 +114,12 @@ func (a *Client) DetailSpec(params *DetailSpecParams) (*DetailSpecOK, error) { Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). */ -func (a *Client) DetailSpecBody(params *DetailSpecBodyParams) (*DetailSpecBodyOK, error) { +func (a *Client) DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailSpecBodyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailSpecBody", Method: "GET", PathPattern: "/specs/{id}/spec", @@ -126,7 +130,12 @@ func (a *Client) DetailSpecBody(params *DetailSpecBodyParams) (*DetailSpecBodyOK 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 } @@ -140,50 +149,15 @@ func (a *Client) DetailSpecBody(params *DetailSpecBodyParams) (*DetailSpecBodyOK panic(msg) } -/* - ListProtocols returns a list of the listening edge protocols -*/ -func (a *Client) ListProtocols(params *ListProtocolsParams) (*ListProtocolsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListProtocolsParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) (*ListRootOK, error) { +func (a *Client) ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListRootParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listRoot", Method: "GET", PathPattern: "/", @@ -194,7 +168,12 @@ func (a *Client) ListRoot(params *ListRootParams) (*ListRootOK, error) { 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 } @@ -213,13 +192,12 @@ func (a *Client) ListRoot(params *ListRootParams) (*ListRootOK, error) { Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion */ -func (a *Client) ListSpecs(params *ListSpecsParams) (*ListSpecsOK, error) { +func (a *Client) ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSpecsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listSpecs", Method: "GET", PathPattern: "/specs", @@ -230,7 +208,12 @@ func (a *Client) ListSpecs(params *ListSpecsParams) (*ListSpecsOK, error) { 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 } @@ -249,13 +232,12 @@ func (a *Client) ListSpecs(params *ListSpecsParams) (*ListSpecsOK, error) { This endpoint is usefull for UIs that wish to display UI elements with counts. */ -func (a *Client) ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter) (*ListSummaryOK, error) { +func (a *Client) ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSummaryOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSummaryParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listSummary", Method: "GET", PathPattern: "/summary", @@ -267,7 +249,12 @@ func (a *Client) ListSummary(params *ListSummaryParams, authInfo runtime.ClientA 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 } @@ -284,13 +271,12 @@ func (a *Client) ListSummary(params *ListSummaryParams, authInfo runtime.ClientA /* ListVersion returns version information */ -func (a *Client) ListVersion(params *ListVersionParams) (*ListVersionOK, error) { +func (a *Client) ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListVersionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listVersion", Method: "GET", PathPattern: "/version", @@ -301,7 +287,12 @@ func (a *Client) ListVersion(params *ListVersionParams) (*ListVersionOK, error) 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 } diff --git a/rest_management_api_client/informational/list_root_parameters.go b/rest_management_api_client/informational/list_root_parameters.go new file mode 100644 index 000000000..b614f3fdb --- /dev/null +++ b/rest_management_api_client/informational/list_root_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4df8c49e7 --- /dev/null +++ b/rest_management_api_client/informational/list_root_responses.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..ebaa0b8be --- /dev/null +++ b/rest_management_api_client/informational/list_specs_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..fa392d324 --- /dev/null +++ b/rest_management_api_client/informational/list_specs_responses.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/informational/list_summary_parameters.go b/rest_management_api_client/informational/list_summary_parameters.go similarity index 76% rename from rest_client/informational/list_summary_parameters.go rename to rest_management_api_client/informational/list_summary_parameters.go index ca358dd9b..62718efc7 100644 --- a/rest_client/informational/list_summary_parameters.go +++ b/rest_management_api_client/informational/list_summary_parameters.go @@ -40,47 +40,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSummaryParams creates a new ListSummaryParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -88,6 +87,21 @@ type ListSummaryParams struct { 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) diff --git a/rest_client/informational/list_summary_responses.go b/rest_management_api_client/informational/list_summary_responses.go similarity index 95% rename from rest_client/informational/list_summary_responses.go rename to rest_management_api_client/informational/list_summary_responses.go index 7a15f4ebf..1d85829cd 100644 --- a/rest_client/informational/list_summary_responses.go +++ b/rest_management_api_client/informational/list_summary_responses.go @@ -59,7 +59,6 @@ func (o *ListSummaryReader) ReadResponse(response runtime.ClientResponse, consum 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()) } @@ -70,7 +69,7 @@ func NewListSummaryOK() *ListSummaryOK { return &ListSummaryOK{} } -/*ListSummaryOK handles this case with default header values. +/* ListSummaryOK describes a response with status code 200, with default header values. Entity counts scopped to the current identitie's access */ @@ -81,7 +80,6 @@ type ListSummaryOK struct { 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 } @@ -103,7 +101,7 @@ func NewListSummaryUnauthorized() *ListSummaryUnauthorized { return &ListSummaryUnauthorized{} } -/*ListSummaryUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListSummaryUnauthorized struct { 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 } diff --git a/rest_management_api_client/informational/list_version_parameters.go b/rest_management_api_client/informational/list_version_parameters.go new file mode 100644 index 000000000..77c18127a --- /dev/null +++ b/rest_management_api_client/informational/list_version_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d1523fce3 --- /dev/null +++ b/rest_management_api_client/informational/list_version_responses.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/posture_checks/create_posture_check_parameters.go b/rest_management_api_client/posture_checks/create_posture_check_parameters.go similarity index 79% rename from rest_client/posture_checks/create_posture_check_parameters.go rename to rest_management_api_client/posture_checks/create_posture_check_parameters.go index e7a681d61..65165effd 100644 --- a/rest_client/posture_checks/create_posture_check_parameters.go +++ b/rest_management_api_client/posture_checks/create_posture_check_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreatePostureCheckParams creates a new CreatePostureCheckParams object -// with the default values initialized. +// 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 { - var () return &CreatePostureCheckParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePostureCheckParamsWithTimeout creates a new CreatePostureCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePostureCheckParamsWithTimeout(timeout time.Duration) *CreatePostureCheckParams { - var () return &CreatePostureCheckParams{ - timeout: timeout, } } // NewCreatePostureCheckParamsWithContext creates a new CreatePostureCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePostureCheckParamsWithContext(ctx context.Context) *CreatePostureCheckParams { - var () return &CreatePostureCheckParams{ - Context: ctx, } } // NewCreatePostureCheckParamsWithHTTPClient creates a new CreatePostureCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePostureCheckParamsWithHTTPClient(client *http.Client) *CreatePostureCheckParams { - var () 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 +/* 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. + A Posture Check to create */ PostureCheck rest_model.PostureCheckCreate @@ -97,6 +96,21 @@ type CreatePostureCheckParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreatePostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.PostureCheck); err != nil { return err } diff --git a/rest_client/posture_checks/create_posture_check_responses.go b/rest_management_api_client/posture_checks/create_posture_check_responses.go similarity index 94% rename from rest_client/posture_checks/create_posture_check_responses.go rename to rest_management_api_client/posture_checks/create_posture_check_responses.go index 248ca8d8e..f5f42f734 100644 --- a/rest_client/posture_checks/create_posture_check_responses.go +++ b/rest_management_api_client/posture_checks/create_posture_check_responses.go @@ -65,7 +65,6 @@ func (o *CreatePostureCheckReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewCreatePostureCheckCreated() *CreatePostureCheckCreated { return &CreatePostureCheckCreated{} } -/*CreatePostureCheckCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreatePostureCheckCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreatePostureCheckBadRequest() *CreatePostureCheckBadRequest { return &CreatePostureCheckBadRequest{} } -/*CreatePostureCheckBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreatePostureCheckBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreatePostureCheckUnauthorized() *CreatePostureCheckUnauthorized { return &CreatePostureCheckUnauthorized{} } -/*CreatePostureCheckUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreatePostureCheckUnauthorized struct { 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 } diff --git a/rest_client/posture_checks/delete_posture_check_parameters.go b/rest_management_api_client/posture_checks/delete_posture_check_parameters.go similarity index 78% rename from rest_client/posture_checks/delete_posture_check_parameters.go rename to rest_management_api_client/posture_checks/delete_posture_check_parameters.go index b84519e5b..0c78b6936 100644 --- a/rest_client/posture_checks/delete_posture_check_parameters.go +++ b/rest_management_api_client/posture_checks/delete_posture_check_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeletePostureCheckParams creates a new DeletePostureCheckParams object -// with the default values initialized. +// 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 { - var () return &DeletePostureCheckParams{ - timeout: cr.DefaultTimeout, } } // NewDeletePostureCheckParamsWithTimeout creates a new DeletePostureCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeletePostureCheckParamsWithTimeout(timeout time.Duration) *DeletePostureCheckParams { - var () return &DeletePostureCheckParams{ - timeout: timeout, } } // NewDeletePostureCheckParamsWithContext creates a new DeletePostureCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeletePostureCheckParamsWithContext(ctx context.Context) *DeletePostureCheckParams { - var () return &DeletePostureCheckParams{ - Context: ctx, } } // NewDeletePostureCheckParamsWithHTTPClient creates a new DeletePostureCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeletePostureCheckParamsWithHTTPClient(client *http.Client) *DeletePostureCheckParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeletePostureCheckParams struct { 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) diff --git a/rest_client/posture_checks/delete_posture_check_responses.go b/rest_management_api_client/posture_checks/delete_posture_check_responses.go similarity index 94% rename from rest_client/posture_checks/delete_posture_check_responses.go rename to rest_management_api_client/posture_checks/delete_posture_check_responses.go index de3a5964f..d13506b32 100644 --- a/rest_client/posture_checks/delete_posture_check_responses.go +++ b/rest_management_api_client/posture_checks/delete_posture_check_responses.go @@ -65,7 +65,6 @@ func (o *DeletePostureCheckReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewDeletePostureCheckOK() *DeletePostureCheckOK { return &DeletePostureCheckOK{} } -/*DeletePostureCheckOK handles this case with default header values. +/* DeletePostureCheckOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -87,7 +86,6 @@ type DeletePostureCheckOK struct { 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 } @@ -109,7 +107,7 @@ func NewDeletePostureCheckForbidden() *DeletePostureCheckForbidden { return &DeletePostureCheckForbidden{} } -/*DeletePostureCheckForbidden handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DeletePostureCheckForbidden struct { 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 } @@ -142,7 +139,7 @@ func NewDeletePostureCheckNotFound() *DeletePostureCheckNotFound { return &DeletePostureCheckNotFound{} } -/*DeletePostureCheckNotFound handles this case with default header values. +/* DeletePostureCheckNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DeletePostureCheckNotFound struct { 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 } diff --git a/rest_client/posture_checks/detail_posture_check_parameters.go b/rest_management_api_client/posture_checks/detail_posture_check_parameters.go similarity index 78% rename from rest_client/posture_checks/detail_posture_check_parameters.go rename to rest_management_api_client/posture_checks/detail_posture_check_parameters.go index a893e6650..63fe14e6b 100644 --- a/rest_client/posture_checks/detail_posture_check_parameters.go +++ b/rest_management_api_client/posture_checks/detail_posture_check_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailPostureCheckParams creates a new DetailPostureCheckParams object -// with the default values initialized. +// 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 { - var () return &DetailPostureCheckParams{ - timeout: cr.DefaultTimeout, } } // NewDetailPostureCheckParamsWithTimeout creates a new DetailPostureCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailPostureCheckParamsWithTimeout(timeout time.Duration) *DetailPostureCheckParams { - var () return &DetailPostureCheckParams{ - timeout: timeout, } } // NewDetailPostureCheckParamsWithContext creates a new DetailPostureCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailPostureCheckParamsWithContext(ctx context.Context) *DetailPostureCheckParams { - var () return &DetailPostureCheckParams{ - Context: ctx, } } // NewDetailPostureCheckParamsWithHTTPClient creates a new DetailPostureCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailPostureCheckParamsWithHTTPClient(client *http.Client) *DetailPostureCheckParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailPostureCheckParams struct { 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) diff --git a/rest_client/posture_checks/detail_posture_check_responses.go b/rest_management_api_client/posture_checks/detail_posture_check_responses.go similarity index 94% rename from rest_client/posture_checks/detail_posture_check_responses.go rename to rest_management_api_client/posture_checks/detail_posture_check_responses.go index 67b72f1b7..befd1ab0c 100644 --- a/rest_client/posture_checks/detail_posture_check_responses.go +++ b/rest_management_api_client/posture_checks/detail_posture_check_responses.go @@ -65,7 +65,6 @@ func (o *DetailPostureCheckReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -76,7 +75,7 @@ func NewDetailPostureCheckOK() *DetailPostureCheckOK { return &DetailPostureCheckOK{} } -/*DetailPostureCheckOK handles this case with default header values. +/* DetailPostureCheckOK describes a response with status code 200, with default header values. Retrieves a singular posture check by id */ @@ -87,7 +86,6 @@ type DetailPostureCheckOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailPostureCheckUnauthorized() *DetailPostureCheckUnauthorized { return &DetailPostureCheckUnauthorized{} } -/*DetailPostureCheckUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailPostureCheckUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailPostureCheckNotFound() *DetailPostureCheckNotFound { return &DetailPostureCheckNotFound{} } -/*DetailPostureCheckNotFound handles this case with default header values. +/* DetailPostureCheckNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailPostureCheckNotFound struct { 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 } diff --git a/rest_client/posture_checks/detail_posture_check_type_parameters.go b/rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go similarity index 78% rename from rest_client/posture_checks/detail_posture_check_type_parameters.go rename to rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go index 8bc1ed206..1f9f26ffc 100644 --- a/rest_client/posture_checks/detail_posture_check_type_parameters.go +++ b/rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailPostureCheckTypeParams creates a new DetailPostureCheckTypeParams object -// with the default values initialized. +// 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 { - var () return &DetailPostureCheckTypeParams{ - timeout: cr.DefaultTimeout, } } // NewDetailPostureCheckTypeParamsWithTimeout creates a new DetailPostureCheckTypeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailPostureCheckTypeParamsWithTimeout(timeout time.Duration) *DetailPostureCheckTypeParams { - var () return &DetailPostureCheckTypeParams{ - timeout: timeout, } } // NewDetailPostureCheckTypeParamsWithContext creates a new DetailPostureCheckTypeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailPostureCheckTypeParamsWithContext(ctx context.Context) *DetailPostureCheckTypeParams { - var () return &DetailPostureCheckTypeParams{ - Context: ctx, } } // NewDetailPostureCheckTypeParamsWithHTTPClient creates a new DetailPostureCheckTypeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailPostureCheckTypeParamsWithHTTPClient(client *http.Client) *DetailPostureCheckTypeParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailPostureCheckTypeParams struct { 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) diff --git a/rest_client/posture_checks/detail_posture_check_type_responses.go b/rest_management_api_client/posture_checks/detail_posture_check_type_responses.go similarity index 94% rename from rest_client/posture_checks/detail_posture_check_type_responses.go rename to rest_management_api_client/posture_checks/detail_posture_check_type_responses.go index 977fde38e..32c956460 100644 --- a/rest_client/posture_checks/detail_posture_check_type_responses.go +++ b/rest_management_api_client/posture_checks/detail_posture_check_type_responses.go @@ -65,7 +65,6 @@ func (o *DetailPostureCheckTypeReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewDetailPostureCheckTypeOK() *DetailPostureCheckTypeOK { return &DetailPostureCheckTypeOK{} } -/*DetailPostureCheckTypeOK handles this case with default header values. +/* DetailPostureCheckTypeOK describes a response with status code 200, with default header values. Retrieves a singular posture check type by id */ @@ -87,7 +86,6 @@ type DetailPostureCheckTypeOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailPostureCheckTypeUnauthorized() *DetailPostureCheckTypeUnauthorized return &DetailPostureCheckTypeUnauthorized{} } -/*DetailPostureCheckTypeUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailPostureCheckTypeUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailPostureCheckTypeNotFound() *DetailPostureCheckTypeNotFound { return &DetailPostureCheckTypeNotFound{} } -/*DetailPostureCheckTypeNotFound handles this case with default header values. +/* DetailPostureCheckTypeNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailPostureCheckTypeNotFound struct { 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 } diff --git a/rest_client/posture_checks/list_posture_check_types_parameters.go b/rest_management_api_client/posture_checks/list_posture_check_types_parameters.go similarity index 83% rename from rest_client/posture_checks/list_posture_check_types_parameters.go rename to rest_management_api_client/posture_checks/list_posture_check_types_parameters.go index 93d6786d0..cc859fd02 100644 --- a/rest_client/posture_checks/list_posture_check_types_parameters.go +++ b/rest_management_api_client/posture_checks/list_posture_check_types_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListPostureCheckTypesParams creates a new ListPostureCheckTypesParams object -// with the default values initialized. +// 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 { - var () return &ListPostureCheckTypesParams{ - timeout: cr.DefaultTimeout, } } // NewListPostureCheckTypesParamsWithTimeout creates a new ListPostureCheckTypesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListPostureCheckTypesParamsWithTimeout(timeout time.Duration) *ListPostureCheckTypesParams { - var () return &ListPostureCheckTypesParams{ - timeout: timeout, } } // NewListPostureCheckTypesParamsWithContext creates a new ListPostureCheckTypesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListPostureCheckTypesParamsWithContext(ctx context.Context) *ListPostureCheckTypesParams { - var () return &ListPostureCheckTypesParams{ - Context: ctx, } } // NewListPostureCheckTypesParamsWithHTTPClient creates a new ListPostureCheckTypesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListPostureCheckTypesParamsWithHTTPClient(client *http.Client) *ListPostureCheckTypesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListPostureCheckTypesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListPostureCheckTypesParams) WriteToRequest(r runtime.ClientRequest, re // 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 { diff --git a/rest_client/posture_checks/list_posture_check_types_responses.go b/rest_management_api_client/posture_checks/list_posture_check_types_responses.go similarity index 96% rename from rest_client/posture_checks/list_posture_check_types_responses.go rename to rest_management_api_client/posture_checks/list_posture_check_types_responses.go index af4e60c72..498e78938 100644 --- a/rest_client/posture_checks/list_posture_check_types_responses.go +++ b/rest_management_api_client/posture_checks/list_posture_check_types_responses.go @@ -53,7 +53,6 @@ func (o *ListPostureCheckTypesReader) ReadResponse(response runtime.ClientRespon 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()) } @@ -64,7 +63,7 @@ func NewListPostureCheckTypesOK() *ListPostureCheckTypesOK { return &ListPostureCheckTypesOK{} } -/*ListPostureCheckTypesOK handles this case with default header values. +/* ListPostureCheckTypesOK describes a response with status code 200, with default header values. A list of posture check types */ @@ -75,7 +74,6 @@ type ListPostureCheckTypesOK struct { 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 } diff --git a/rest_client/posture_checks/list_posture_checks_parameters.go b/rest_management_api_client/posture_checks/list_posture_checks_parameters.go similarity index 78% rename from rest_client/posture_checks/list_posture_checks_parameters.go rename to rest_management_api_client/posture_checks/list_posture_checks_parameters.go index 55a7b5390..954132729 100644 --- a/rest_client/posture_checks/list_posture_checks_parameters.go +++ b/rest_management_api_client/posture_checks/list_posture_checks_parameters.go @@ -41,59 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListPostureChecksParams creates a new ListPostureChecksParams object -// with the default values initialized. +// 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 { - var () return &ListPostureChecksParams{ - timeout: cr.DefaultTimeout, } } // NewListPostureChecksParamsWithTimeout creates a new ListPostureChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListPostureChecksParamsWithTimeout(timeout time.Duration) *ListPostureChecksParams { - var () return &ListPostureChecksParams{ - timeout: timeout, } } // NewListPostureChecksParamsWithContext creates a new ListPostureChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListPostureChecksParamsWithContext(ctx context.Context) *ListPostureChecksParams { - var () return &ListPostureChecksParams{ - Context: ctx, } } // NewListPostureChecksParamsWithHTTPClient creates a new ListPostureChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListPostureChecksParamsWithHTTPClient(client *http.Client) *ListPostureChecksParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 - /*RoleFilter*/ + + // RoleFilter. RoleFilter []string - /*RoleSemantic*/ + + // RoleSemantic. RoleSemantic *string timeout time.Duration @@ -101,6 +104,21 @@ type ListPostureChecksParams struct { 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) @@ -201,72 +219,79 @@ func (o *ListPostureChecksParams) WriteToRequest(r runtime.ClientRequest, reg st // 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 } } - } - valuesRoleFilter := o.RoleFilter + if o.RoleFilter != nil { - joinedRoleFilter := swag.JoinByFormat(valuesRoleFilter, "multi") - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err + // 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 { @@ -274,3 +299,20 @@ func (o *ListPostureChecksParams) WriteToRequest(r runtime.ClientRequest, reg st } 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_client/posture_checks/list_posture_checks_responses.go b/rest_management_api_client/posture_checks/list_posture_checks_responses.go similarity index 96% rename from rest_client/posture_checks/list_posture_checks_responses.go rename to rest_management_api_client/posture_checks/list_posture_checks_responses.go index ad51712c8..2e7fd3c5e 100644 --- a/rest_client/posture_checks/list_posture_checks_responses.go +++ b/rest_management_api_client/posture_checks/list_posture_checks_responses.go @@ -53,7 +53,6 @@ func (o *ListPostureChecksReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -64,7 +63,7 @@ func NewListPostureChecksOK() *ListPostureChecksOK { return &ListPostureChecksOK{} } -/*ListPostureChecksOK handles this case with default header values. +/* ListPostureChecksOK describes a response with status code 200, with default header values. A list of posture checks */ @@ -75,7 +74,6 @@ type ListPostureChecksOK struct { 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 } diff --git a/rest_client/posture_checks/patch_posture_check_parameters.go b/rest_management_api_client/posture_checks/patch_posture_check_parameters.go similarity index 80% rename from rest_client/posture_checks/patch_posture_check_parameters.go rename to rest_management_api_client/posture_checks/patch_posture_check_parameters.go index 08f661f10..a35d93364 100644 --- a/rest_client/posture_checks/patch_posture_check_parameters.go +++ b/rest_management_api_client/posture_checks/patch_posture_check_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchPostureCheckParams creates a new PatchPostureCheckParams object -// with the default values initialized. +// 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 { - var () return &PatchPostureCheckParams{ - timeout: cr.DefaultTimeout, } } // NewPatchPostureCheckParamsWithTimeout creates a new PatchPostureCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchPostureCheckParamsWithTimeout(timeout time.Duration) *PatchPostureCheckParams { - var () return &PatchPostureCheckParams{ - timeout: timeout, } } // NewPatchPostureCheckParamsWithContext creates a new PatchPostureCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchPostureCheckParamsWithContext(ctx context.Context) *PatchPostureCheckParams { - var () return &PatchPostureCheckParams{ - Context: ctx, } } // NewPatchPostureCheckParamsWithHTTPClient creates a new PatchPostureCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchPostureCheckParamsWithHTTPClient(client *http.Client) *PatchPostureCheckParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*PostureCheck - A Posture Check patch object + /* PostureCheck. + + A Posture Check patch object */ PostureCheck rest_model.PostureCheckPatch @@ -102,6 +102,21 @@ type PatchPostureCheckParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchPostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg st if err := r.SetPathParam("id", o.ID); err != nil { return err } - if err := r.SetBodyParam(o.PostureCheck); err != nil { return err } diff --git a/rest_client/posture_checks/patch_posture_check_responses.go b/rest_management_api_client/posture_checks/patch_posture_check_responses.go similarity index 94% rename from rest_client/posture_checks/patch_posture_check_responses.go rename to rest_management_api_client/posture_checks/patch_posture_check_responses.go index 73c9eb108..17e0a1e80 100644 --- a/rest_client/posture_checks/patch_posture_check_responses.go +++ b/rest_management_api_client/posture_checks/patch_posture_check_responses.go @@ -71,7 +71,6 @@ func (o *PatchPostureCheckReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -82,7 +81,7 @@ func NewPatchPostureCheckOK() *PatchPostureCheckOK { return &PatchPostureCheckOK{} } -/*PatchPostureCheckOK handles this case with default header values. +/* PatchPostureCheckOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchPostureCheckOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchPostureCheckBadRequest() *PatchPostureCheckBadRequest { return &PatchPostureCheckBadRequest{} } -/*PatchPostureCheckBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchPostureCheckBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchPostureCheckUnauthorized() *PatchPostureCheckUnauthorized { return &PatchPostureCheckUnauthorized{} } -/*PatchPostureCheckUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchPostureCheckUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchPostureCheckNotFound() *PatchPostureCheckNotFound { return &PatchPostureCheckNotFound{} } -/*PatchPostureCheckNotFound handles this case with default header values. +/* PatchPostureCheckNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchPostureCheckNotFound struct { 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 } diff --git a/rest_client/posture_checks/posture_checks_client.go b/rest_management_api_client/posture_checks/posture_checks_client.go similarity index 72% rename from rest_client/posture_checks/posture_checks_client.go rename to rest_management_api_client/posture_checks/posture_checks_client.go index 7dabc6629..1368a4e4e 100644 --- a/rest_client/posture_checks/posture_checks_client.go +++ b/rest_management_api_client/posture_checks/posture_checks_client.go @@ -49,27 +49,26 @@ type Client struct { 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) (*CreatePostureCheckCreated, error) + CreatePostureCheck(params *CreatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureCheckCreated, error) - CreatePostureResponse(params *CreatePostureResponseParams, authInfo runtime.ClientAuthInfoWriter) (*CreatePostureResponseCreated, error) + DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostureCheckOK, error) - CreatePostureResponseBulk(params *CreatePostureResponseBulkParams, authInfo runtime.ClientAuthInfoWriter) (*CreatePostureResponseBulkOK, error) + DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckOK, error) - DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePostureCheckOK, error) + DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckTypeOK, error) - DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*DetailPostureCheckOK, error) + ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckTypesOK, error) - DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailPostureCheckTypeOK, error) + ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureChecksOK, error) - ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListPostureCheckTypesOK, error) + PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchPostureCheckOK, error) - ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter) (*ListPostureChecksOK, error) - - PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*PatchPostureCheckOK, error) - - UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePostureCheckOK, error) + UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostureCheckOK, error) SetTransport(transport runtime.ClientTransport) } @@ -79,13 +78,12 @@ type ClientService interface { Creates a Posture Checks */ -func (a *Client) CreatePostureCheck(params *CreatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*CreatePostureCheckCreated, error) { +func (a *Client) CreatePostureCheck(params *CreatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureCheckCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreatePostureCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createPostureCheck", Method: "POST", PathPattern: "/posture-checks", @@ -97,7 +95,12 @@ func (a *Client) CreatePostureCheck(params *CreatePostureCheckParams, authInfo r 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 } @@ -111,92 +114,17 @@ func (a *Client) CreatePostureCheck(params *CreatePostureCheckParams, authInfo r panic(msg) } -/* - CreatePostureResponse submits a posture response to a posture query - - Submits posture responses -*/ -func (a *Client) CreatePostureResponse(params *CreatePostureResponseParams, authInfo runtime.ClientAuthInfoWriter) (*CreatePostureResponseCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePostureResponseParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) (*CreatePostureResponseBulkOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePostureResponseBulkParams() - } - - result, err := a.transport.Submit(&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, - }) - 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) -} - /* DeletePostureCheck deletes an posture checks Deletes and Posture Checks by id */ -func (a *Client) DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePostureCheckOK, error) { +func (a *Client) DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostureCheckOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeletePostureCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deletePostureCheck", Method: "DELETE", PathPattern: "/posture-checks/{id}", @@ -208,7 +136,12 @@ func (a *Client) DeletePostureCheck(params *DeletePostureCheckParams, authInfo r 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 } @@ -227,13 +160,12 @@ func (a *Client) DeletePostureCheck(params *DeletePostureCheckParams, authInfo r Retrieves a single Posture Checks by id */ -func (a *Client) DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*DetailPostureCheckOK, error) { +func (a *Client) DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailPostureCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailPostureCheck", Method: "GET", PathPattern: "/posture-checks/{id}", @@ -245,7 +177,12 @@ func (a *Client) DetailPostureCheck(params *DetailPostureCheckParams, authInfo r 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 } @@ -264,13 +201,12 @@ func (a *Client) DetailPostureCheck(params *DetailPostureCheckParams, authInfo r Retrieves a single posture check type by id */ -func (a *Client) DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter) (*DetailPostureCheckTypeOK, error) { +func (a *Client) DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckTypeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailPostureCheckTypeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailPostureCheckType", Method: "GET", PathPattern: "/posture-check-types/{id}", @@ -282,7 +218,12 @@ func (a *Client) DetailPostureCheckType(params *DetailPostureCheckTypeParams, au 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 } @@ -302,13 +243,12 @@ func (a *Client) DetailPostureCheckType(params *DetailPostureCheckTypeParams, au Retrieves a list of posture check types */ -func (a *Client) ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListPostureCheckTypesOK, error) { +func (a *Client) ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckTypesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListPostureCheckTypesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listPostureCheckTypes", Method: "GET", PathPattern: "/posture-check-types", @@ -320,7 +260,12 @@ func (a *Client) ListPostureCheckTypes(params *ListPostureCheckTypesParams, auth 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 } @@ -340,13 +285,12 @@ func (a *Client) ListPostureCheckTypes(params *ListPostureCheckTypesParams, auth Retrieves a list of posture checks */ -func (a *Client) ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter) (*ListPostureChecksOK, error) { +func (a *Client) ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListPostureChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listPostureChecks", Method: "GET", PathPattern: "/posture-checks", @@ -358,7 +302,12 @@ func (a *Client) ListPostureChecks(params *ListPostureChecksParams, authInfo run 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 } @@ -377,13 +326,12 @@ func (a *Client) ListPostureChecks(params *ListPostureChecksParams, authInfo run Update only the supplied fields on a Posture Checks by id */ -func (a *Client) PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*PatchPostureCheckOK, error) { +func (a *Client) PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchPostureCheckOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchPostureCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchPostureCheck", Method: "PATCH", PathPattern: "/posture-checks/{id}", @@ -395,7 +343,12 @@ func (a *Client) PatchPostureCheck(params *PatchPostureCheckParams, authInfo run 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 } @@ -414,13 +367,12 @@ func (a *Client) PatchPostureCheck(params *PatchPostureCheckParams, authInfo run Update all fields on a Posture Checks by id */ -func (a *Client) UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter) (*UpdatePostureCheckOK, error) { +func (a *Client) UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostureCheckOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdatePostureCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updatePostureCheck", Method: "PUT", PathPattern: "/posture-checks/{id}", @@ -432,7 +384,12 @@ func (a *Client) UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo r 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 } diff --git a/rest_client/posture_checks/update_posture_check_parameters.go b/rest_management_api_client/posture_checks/update_posture_check_parameters.go similarity index 80% rename from rest_client/posture_checks/update_posture_check_parameters.go rename to rest_management_api_client/posture_checks/update_posture_check_parameters.go index 1b809cd9a..e86b8e78d 100644 --- a/rest_client/posture_checks/update_posture_check_parameters.go +++ b/rest_management_api_client/posture_checks/update_posture_check_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdatePostureCheckParams creates a new UpdatePostureCheckParams object -// with the default values initialized. +// 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 { - var () return &UpdatePostureCheckParams{ - timeout: cr.DefaultTimeout, } } // NewUpdatePostureCheckParamsWithTimeout creates a new UpdatePostureCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdatePostureCheckParamsWithTimeout(timeout time.Duration) *UpdatePostureCheckParams { - var () return &UpdatePostureCheckParams{ - timeout: timeout, } } // NewUpdatePostureCheckParamsWithContext creates a new UpdatePostureCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdatePostureCheckParamsWithContext(ctx context.Context) *UpdatePostureCheckParams { - var () return &UpdatePostureCheckParams{ - Context: ctx, } } // NewUpdatePostureCheckParamsWithHTTPClient creates a new UpdatePostureCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdatePostureCheckParamsWithHTTPClient(client *http.Client) *UpdatePostureCheckParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*PostureCheck - A Posture Check update object + /* PostureCheck. + + A Posture Check update object */ PostureCheck rest_model.PostureCheckUpdate @@ -102,6 +102,21 @@ type UpdatePostureCheckParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdatePostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg s if err := r.SetPathParam("id", o.ID); err != nil { return err } - if err := r.SetBodyParam(o.PostureCheck); err != nil { return err } diff --git a/rest_client/posture_checks/update_posture_check_responses.go b/rest_management_api_client/posture_checks/update_posture_check_responses.go similarity index 94% rename from rest_client/posture_checks/update_posture_check_responses.go rename to rest_management_api_client/posture_checks/update_posture_check_responses.go index edb54af7d..771f05a88 100644 --- a/rest_client/posture_checks/update_posture_check_responses.go +++ b/rest_management_api_client/posture_checks/update_posture_check_responses.go @@ -71,7 +71,6 @@ func (o *UpdatePostureCheckReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -82,7 +81,7 @@ func NewUpdatePostureCheckOK() *UpdatePostureCheckOK { return &UpdatePostureCheckOK{} } -/*UpdatePostureCheckOK handles this case with default header values. +/* UpdatePostureCheckOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdatePostureCheckOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdatePostureCheckBadRequest() *UpdatePostureCheckBadRequest { return &UpdatePostureCheckBadRequest{} } -/*UpdatePostureCheckBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdatePostureCheckBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdatePostureCheckUnauthorized() *UpdatePostureCheckUnauthorized { return &UpdatePostureCheckUnauthorized{} } -/*UpdatePostureCheckUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdatePostureCheckUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdatePostureCheckNotFound() *UpdatePostureCheckNotFound { return &UpdatePostureCheckNotFound{} } -/*UpdatePostureCheckNotFound handles this case with default header values. +/* UpdatePostureCheckNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdatePostureCheckNotFound struct { 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 } diff --git a/rest_client/role_attributes/list_edge_router_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go similarity index 83% rename from rest_client/role_attributes/list_edge_router_role_attributes_parameters.go rename to rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go index 928a70de2..08a203ded 100644 --- a/rest_client/role_attributes/list_edge_router_role_attributes_parameters.go +++ b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListEdgeRouterRoleAttributesParams creates a new ListEdgeRouterRoleAttributesParams object -// with the default values initialized. +// 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 { - var () return &ListEdgeRouterRoleAttributesParams{ - timeout: cr.DefaultTimeout, } } // NewListEdgeRouterRoleAttributesParamsWithTimeout creates a new ListEdgeRouterRoleAttributesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListEdgeRouterRoleAttributesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterRoleAttributesParams { - var () return &ListEdgeRouterRoleAttributesParams{ - timeout: timeout, } } // NewListEdgeRouterRoleAttributesParamsWithContext creates a new ListEdgeRouterRoleAttributesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListEdgeRouterRoleAttributesParamsWithContext(ctx context.Context) *ListEdgeRouterRoleAttributesParams { - var () return &ListEdgeRouterRoleAttributesParams{ - Context: ctx, } } // NewListEdgeRouterRoleAttributesParamsWithHTTPClient creates a new ListEdgeRouterRoleAttributesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListEdgeRouterRoleAttributesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterRoleAttributesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListEdgeRouterRoleAttributesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListEdgeRouterRoleAttributesParams) WriteToRequest(r runtime.ClientRequ // 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 { diff --git a/rest_client/role_attributes/list_edge_router_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go similarity index 95% rename from rest_client/role_attributes/list_edge_router_role_attributes_responses.go rename to rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go index 654701fff..84962084a 100644 --- a/rest_client/role_attributes/list_edge_router_role_attributes_responses.go +++ b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go @@ -59,7 +59,6 @@ func (o *ListEdgeRouterRoleAttributesReader) ReadResponse(response runtime.Clien 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()) } @@ -70,7 +69,7 @@ func NewListEdgeRouterRoleAttributesOK() *ListEdgeRouterRoleAttributesOK { return &ListEdgeRouterRoleAttributesOK{} } -/*ListEdgeRouterRoleAttributesOK handles this case with default header values. +/* ListEdgeRouterRoleAttributesOK describes a response with status code 200, with default header values. A list of role attributes */ @@ -81,7 +80,6 @@ type ListEdgeRouterRoleAttributesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListEdgeRouterRoleAttributesUnauthorized() *ListEdgeRouterRoleAttributes return &ListEdgeRouterRoleAttributesUnauthorized{} } -/*ListEdgeRouterRoleAttributesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListEdgeRouterRoleAttributesUnauthorized struct { 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 } diff --git a/rest_client/role_attributes/list_identity_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go similarity index 83% rename from rest_client/role_attributes/list_identity_role_attributes_parameters.go rename to rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go index fb0d5789a..7f4426f33 100644 --- a/rest_client/role_attributes/list_identity_role_attributes_parameters.go +++ b/rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListIdentityRoleAttributesParams creates a new ListIdentityRoleAttributesParams object -// with the default values initialized. +// 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 { - var () return &ListIdentityRoleAttributesParams{ - timeout: cr.DefaultTimeout, } } // NewListIdentityRoleAttributesParamsWithTimeout creates a new ListIdentityRoleAttributesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListIdentityRoleAttributesParamsWithTimeout(timeout time.Duration) *ListIdentityRoleAttributesParams { - var () return &ListIdentityRoleAttributesParams{ - timeout: timeout, } } // NewListIdentityRoleAttributesParamsWithContext creates a new ListIdentityRoleAttributesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListIdentityRoleAttributesParamsWithContext(ctx context.Context) *ListIdentityRoleAttributesParams { - var () return &ListIdentityRoleAttributesParams{ - Context: ctx, } } // NewListIdentityRoleAttributesParamsWithHTTPClient creates a new ListIdentityRoleAttributesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListIdentityRoleAttributesParamsWithHTTPClient(client *http.Client) *ListIdentityRoleAttributesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListIdentityRoleAttributesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListIdentityRoleAttributesParams) WriteToRequest(r runtime.ClientReques // 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 { diff --git a/rest_client/role_attributes/list_identity_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go similarity index 95% rename from rest_client/role_attributes/list_identity_role_attributes_responses.go rename to rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go index 1a039e58b..54c817dd7 100644 --- a/rest_client/role_attributes/list_identity_role_attributes_responses.go +++ b/rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go @@ -59,7 +59,6 @@ func (o *ListIdentityRoleAttributesReader) ReadResponse(response runtime.ClientR 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()) } @@ -70,7 +69,7 @@ func NewListIdentityRoleAttributesOK() *ListIdentityRoleAttributesOK { return &ListIdentityRoleAttributesOK{} } -/*ListIdentityRoleAttributesOK handles this case with default header values. +/* ListIdentityRoleAttributesOK describes a response with status code 200, with default header values. A list of role attributes */ @@ -81,7 +80,6 @@ type ListIdentityRoleAttributesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListIdentityRoleAttributesUnauthorized() *ListIdentityRoleAttributesUnau return &ListIdentityRoleAttributesUnauthorized{} } -/*ListIdentityRoleAttributesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListIdentityRoleAttributesUnauthorized struct { 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 } diff --git a/rest_client/role_attributes/list_service_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go similarity index 83% rename from rest_client/role_attributes/list_service_role_attributes_parameters.go rename to rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go index 52aa6b888..ef7d6834c 100644 --- a/rest_client/role_attributes/list_service_role_attributes_parameters.go +++ b/rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceRoleAttributesParams creates a new ListServiceRoleAttributesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceRoleAttributesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceRoleAttributesParamsWithTimeout creates a new ListServiceRoleAttributesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceRoleAttributesParamsWithTimeout(timeout time.Duration) *ListServiceRoleAttributesParams { - var () return &ListServiceRoleAttributesParams{ - timeout: timeout, } } // NewListServiceRoleAttributesParamsWithContext creates a new ListServiceRoleAttributesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceRoleAttributesParamsWithContext(ctx context.Context) *ListServiceRoleAttributesParams { - var () return &ListServiceRoleAttributesParams{ - Context: ctx, } } // NewListServiceRoleAttributesParamsWithHTTPClient creates a new ListServiceRoleAttributesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceRoleAttributesParamsWithHTTPClient(client *http.Client) *ListServiceRoleAttributesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListServiceRoleAttributesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListServiceRoleAttributesParams) WriteToRequest(r runtime.ClientRequest // 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 { diff --git a/rest_client/role_attributes/list_service_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_service_role_attributes_responses.go similarity index 95% rename from rest_client/role_attributes/list_service_role_attributes_responses.go rename to rest_management_api_client/role_attributes/list_service_role_attributes_responses.go index c6c942ce5..fc26fcfd8 100644 --- a/rest_client/role_attributes/list_service_role_attributes_responses.go +++ b/rest_management_api_client/role_attributes/list_service_role_attributes_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceRoleAttributesReader) ReadResponse(response runtime.ClientRe 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()) } @@ -70,7 +69,7 @@ func NewListServiceRoleAttributesOK() *ListServiceRoleAttributesOK { return &ListServiceRoleAttributesOK{} } -/*ListServiceRoleAttributesOK handles this case with default header values. +/* ListServiceRoleAttributesOK describes a response with status code 200, with default header values. A list of role attributes */ @@ -81,7 +80,6 @@ type ListServiceRoleAttributesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceRoleAttributesUnauthorized() *ListServiceRoleAttributesUnauth return &ListServiceRoleAttributesUnauthorized{} } -/*ListServiceRoleAttributesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceRoleAttributesUnauthorized struct { 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 } diff --git a/rest_client/role_attributes/role_attributes_client.go b/rest_management_api_client/role_attributes/role_attributes_client.go similarity index 84% rename from rest_client/role_attributes/role_attributes_client.go rename to rest_management_api_client/role_attributes/role_attributes_client.go index 267772eef..985211ddb 100644 --- a/rest_client/role_attributes/role_attributes_client.go +++ b/rest_management_api_client/role_attributes/role_attributes_client.go @@ -49,13 +49,16 @@ type Client struct { 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) (*ListEdgeRouterRoleAttributesOK, error) + ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterRoleAttributesOK, error) - ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter) (*ListIdentityRoleAttributesOK, error) + ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityRoleAttributesOK, error) - ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceRoleAttributesOK, error) + ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceRoleAttributesOK, error) SetTransport(transport runtime.ClientTransport) } @@ -66,13 +69,12 @@ type ClientService interface { 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) (*ListEdgeRouterRoleAttributesOK, error) { +func (a *Client) ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterRoleAttributesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListEdgeRouterRoleAttributesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listEdgeRouterRoleAttributes", Method: "GET", PathPattern: "/edge-router-role-attributes", @@ -84,7 +86,12 @@ func (a *Client) ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttribut 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 } @@ -104,13 +111,12 @@ func (a *Client) ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttribut 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) (*ListIdentityRoleAttributesOK, error) { +func (a *Client) ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityRoleAttributesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListIdentityRoleAttributesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listIdentityRoleAttributes", Method: "GET", PathPattern: "/identity-role-attributes", @@ -122,7 +128,12 @@ func (a *Client) ListIdentityRoleAttributes(params *ListIdentityRoleAttributesPa 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 } @@ -142,13 +153,12 @@ func (a *Client) ListIdentityRoleAttributes(params *ListIdentityRoleAttributesPa 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) (*ListServiceRoleAttributesOK, error) { +func (a *Client) ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceRoleAttributesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceRoleAttributesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceRoleAttributes", Method: "GET", PathPattern: "/service-role-attributes", @@ -160,7 +170,12 @@ func (a *Client) ListServiceRoleAttributes(params *ListServiceRoleAttributesPara 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 } diff --git a/rest_management_api_client/router/create_router_parameters.go b/rest_management_api_client/router/create_router_parameters.go new file mode 100644 index 000000000..8d2bcef08 --- /dev/null +++ b/rest_management_api_client/router/create_router_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1ee7e721d --- /dev/null +++ b/rest_management_api_client/router/create_router_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_client/transit_router/create_transit_router_parameters.go b/rest_management_api_client/router/create_transit_router_parameters.go similarity index 77% rename from rest_client/transit_router/create_transit_router_parameters.go rename to rest_management_api_client/router/create_transit_router_parameters.go index 833defd75..d468f3056 100644 --- a/rest_client/transit_router/create_transit_router_parameters.go +++ b/rest_management_api_client/router/create_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -42,61 +42,75 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateTransitRouterParams creates a new CreateTransitRouterParams object -// with the default values initialized. +// 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 { - var () return &CreateTransitRouterParams{ - timeout: cr.DefaultTimeout, } } // NewCreateTransitRouterParamsWithTimeout creates a new CreateTransitRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateTransitRouterParamsWithTimeout(timeout time.Duration) *CreateTransitRouterParams { - var () return &CreateTransitRouterParams{ - timeout: timeout, } } // NewCreateTransitRouterParamsWithContext creates a new CreateTransitRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateTransitRouterParamsWithContext(ctx context.Context) *CreateTransitRouterParams { - var () return &CreateTransitRouterParams{ - Context: ctx, } } // NewCreateTransitRouterParamsWithHTTPClient creates a new CreateTransitRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateTransitRouterParamsWithHTTPClient(client *http.Client) *CreateTransitRouterParams { - var () 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 +/* 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 transit router to create + /* Router. + A router to create */ - Router *rest_model.TransitRouterCreate + 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) @@ -131,13 +145,13 @@ func (o *CreateTransitRouterParams) SetHTTPClient(client *http.Client) { } // WithRouter adds the router to the create transit router params -func (o *CreateTransitRouterParams) WithRouter(router *rest_model.TransitRouterCreate) *CreateTransitRouterParams { +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.TransitRouterCreate) { +func (o *CreateTransitRouterParams) SetRouter(router *rest_model.RouterCreate) { o.Router = router } @@ -148,7 +162,6 @@ func (o *CreateTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Router != nil { if err := r.SetBodyParam(o.Router); err != nil { return err diff --git a/rest_client/transit_router/create_transit_router_responses.go b/rest_management_api_client/router/create_transit_router_responses.go similarity index 94% rename from rest_client/transit_router/create_transit_router_responses.go rename to rest_management_api_client/router/create_transit_router_responses.go index 9a40a4296..c194afdf9 100644 --- a/rest_client/transit_router/create_transit_router_responses.go +++ b/rest_management_api_client/router/create_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -65,7 +65,6 @@ func (o *CreateTransitRouterReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewCreateTransitRouterCreated() *CreateTransitRouterCreated { return &CreateTransitRouterCreated{} } -/*CreateTransitRouterCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateTransitRouterCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateTransitRouterBadRequest() *CreateTransitRouterBadRequest { return &CreateTransitRouterBadRequest{} } -/*CreateTransitRouterBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateTransitRouterBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateTransitRouterUnauthorized() *CreateTransitRouterUnauthorized { return &CreateTransitRouterUnauthorized{} } -/*CreateTransitRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateTransitRouterUnauthorized struct { 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 } diff --git a/rest_management_api_client/router/delete_router_parameters.go b/rest_management_api_client/router/delete_router_parameters.go new file mode 100644 index 000000000..abe45bcf5 --- /dev/null +++ b/rest_management_api_client/router/delete_router_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e021fe5e8 --- /dev/null +++ b/rest_management_api_client/router/delete_router_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_client/transit_router/delete_transit_router_parameters.go b/rest_management_api_client/router/delete_transit_router_parameters.go similarity index 78% rename from rest_client/transit_router/delete_transit_router_parameters.go rename to rest_management_api_client/router/delete_transit_router_parameters.go index f5f58eecd..79615baa2 100644 --- a/rest_client/transit_router/delete_transit_router_parameters.go +++ b/rest_management_api_client/router/delete_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteTransitRouterParams creates a new DeleteTransitRouterParams object -// with the default values initialized. +// 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 { - var () return &DeleteTransitRouterParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteTransitRouterParamsWithTimeout creates a new DeleteTransitRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteTransitRouterParamsWithTimeout(timeout time.Duration) *DeleteTransitRouterParams { - var () return &DeleteTransitRouterParams{ - timeout: timeout, } } // NewDeleteTransitRouterParamsWithContext creates a new DeleteTransitRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteTransitRouterParamsWithContext(ctx context.Context) *DeleteTransitRouterParams { - var () return &DeleteTransitRouterParams{ - Context: ctx, } } // NewDeleteTransitRouterParamsWithHTTPClient creates a new DeleteTransitRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteTransitRouterParamsWithHTTPClient(client *http.Client) *DeleteTransitRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteTransitRouterParams struct { 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) diff --git a/rest_client/transit_router/delete_transit_router_responses.go b/rest_management_api_client/router/delete_transit_router_responses.go similarity index 93% rename from rest_client/transit_router/delete_transit_router_responses.go rename to rest_management_api_client/router/delete_transit_router_responses.go index d41d1ec4e..57626dee0 100644 --- a/rest_client/transit_router/delete_transit_router_responses.go +++ b/rest_management_api_client/router/delete_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -71,7 +71,6 @@ func (o *DeleteTransitRouterReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -82,7 +81,7 @@ func NewDeleteTransitRouterOK() *DeleteTransitRouterOK { return &DeleteTransitRouterOK{} } -/*DeleteTransitRouterOK handles this case with default header values. +/* DeleteTransitRouterOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteTransitRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteTransitRouterBadRequest() *DeleteTransitRouterBadRequest { return &DeleteTransitRouterBadRequest{} } -/*DeleteTransitRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteTransitRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteTransitRouterUnauthorized() *DeleteTransitRouterUnauthorized { return &DeleteTransitRouterUnauthorized{} } -/*DeleteTransitRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteTransitRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteTransitRouterConflict() *DeleteTransitRouterConflict { return &DeleteTransitRouterConflict{} } -/*DeleteTransitRouterConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteTransitRouterConflict struct { 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 } diff --git a/rest_management_api_client/router/detail_router_parameters.go b/rest_management_api_client/router/detail_router_parameters.go new file mode 100644 index 000000000..36d91bf68 --- /dev/null +++ b/rest_management_api_client/router/detail_router_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9ac6df969 --- /dev/null +++ b/rest_management_api_client/router/detail_router_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_client/transit_router/detail_transit_router_parameters.go b/rest_management_api_client/router/detail_transit_router_parameters.go similarity index 78% rename from rest_client/transit_router/detail_transit_router_parameters.go rename to rest_management_api_client/router/detail_transit_router_parameters.go index 92cbff054..6d5d70592 100644 --- a/rest_client/transit_router/detail_transit_router_parameters.go +++ b/rest_management_api_client/router/detail_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailTransitRouterParams creates a new DetailTransitRouterParams object -// with the default values initialized. +// 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 { - var () return &DetailTransitRouterParams{ - timeout: cr.DefaultTimeout, } } // NewDetailTransitRouterParamsWithTimeout creates a new DetailTransitRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailTransitRouterParamsWithTimeout(timeout time.Duration) *DetailTransitRouterParams { - var () return &DetailTransitRouterParams{ - timeout: timeout, } } // NewDetailTransitRouterParamsWithContext creates a new DetailTransitRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailTransitRouterParamsWithContext(ctx context.Context) *DetailTransitRouterParams { - var () return &DetailTransitRouterParams{ - Context: ctx, } } // NewDetailTransitRouterParamsWithHTTPClient creates a new DetailTransitRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailTransitRouterParamsWithHTTPClient(client *http.Client) *DetailTransitRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailTransitRouterParams struct { 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) diff --git a/rest_client/transit_router/detail_transit_router_responses.go b/rest_management_api_client/router/detail_transit_router_responses.go similarity index 90% rename from rest_client/transit_router/detail_transit_router_responses.go rename to rest_management_api_client/router/detail_transit_router_responses.go index 79e71d159..d44fc090c 100644 --- a/rest_client/transit_router/detail_transit_router_responses.go +++ b/rest_management_api_client/router/detail_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -65,7 +65,6 @@ func (o *DetailTransitRouterReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,25 +75,24 @@ func NewDetailTransitRouterOK() *DetailTransitRouterOK { return &DetailTransitRouterOK{} } -/*DetailTransitRouterOK handles this case with default header values. +/* DetailTransitRouterOK describes a response with status code 200, with default header values. -A single transit router +A single router */ type DetailTransitRouterOK struct { - Payload *rest_model.DetailTransitRouterEnvelope + 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.DetailTransitRouterEnvelope { +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.DetailTransitRouterEnvelope) + o.Payload = new(rest_model.DetailRouterEnvelope) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -109,7 +107,7 @@ func NewDetailTransitRouterUnauthorized() *DetailTransitRouterUnauthorized { return &DetailTransitRouterUnauthorized{} } -/*DetailTransitRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailTransitRouterUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailTransitRouterNotFound() *DetailTransitRouterNotFound { return &DetailTransitRouterNotFound{} } -/*DetailTransitRouterNotFound handles this case with default header values. +/* DetailTransitRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailTransitRouterNotFound struct { 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 } diff --git a/rest_management_api_client/router/list_routers_parameters.go b/rest_management_api_client/router/list_routers_parameters.go new file mode 100644 index 000000000..f28c70254 --- /dev/null +++ b/rest_management_api_client/router/list_routers_parameters.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4a9ae430e --- /dev/null +++ b/rest_management_api_client/router/list_routers_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 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 +} + +// 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_client/transit_router/list_transit_routers_parameters.go b/rest_management_api_client/router/list_transit_routers_parameters.go similarity index 82% rename from rest_client/transit_router/list_transit_routers_parameters.go rename to rest_management_api_client/router/list_transit_routers_parameters.go index c1ffa0905..2d5b2ac46 100644 --- a/rest_client/transit_router/list_transit_routers_parameters.go +++ b/rest_management_api_client/router/list_transit_routers_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListTransitRoutersParams creates a new ListTransitRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListTransitRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListTransitRoutersParamsWithTimeout creates a new ListTransitRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListTransitRoutersParamsWithTimeout(timeout time.Duration) *ListTransitRoutersParams { - var () return &ListTransitRoutersParams{ - timeout: timeout, } } // NewListTransitRoutersParamsWithContext creates a new ListTransitRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListTransitRoutersParamsWithContext(ctx context.Context) *ListTransitRoutersParams { - var () return &ListTransitRoutersParams{ - Context: ctx, } } // NewListTransitRoutersParamsWithHTTPClient creates a new ListTransitRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListTransitRoutersParamsWithHTTPClient(client *http.Client) *ListTransitRoutersParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListTransitRoutersParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListTransitRoutersParams) WriteToRequest(r runtime.ClientRequest, reg s // 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 { diff --git a/rest_client/transit_router/list_transit_routers_responses.go b/rest_management_api_client/router/list_transit_routers_responses.go similarity index 91% rename from rest_client/transit_router/list_transit_routers_responses.go rename to rest_management_api_client/router/list_transit_routers_responses.go index c2a9a2cd2..117cf1980 100644 --- a/rest_client/transit_router/list_transit_routers_responses.go +++ b/rest_management_api_client/router/list_transit_routers_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -59,7 +59,6 @@ func (o *ListTransitRoutersReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -70,25 +69,24 @@ func NewListTransitRoutersOK() *ListTransitRoutersOK { return &ListTransitRoutersOK{} } -/*ListTransitRoutersOK handles this case with default header values. +/* ListTransitRoutersOK describes a response with status code 200, with default header values. A list of specifications */ type ListTransitRoutersOK struct { - Payload *rest_model.ListTransitRoutersEnvelope + 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.ListTransitRoutersEnvelope { +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.ListTransitRoutersEnvelope) + o.Payload = new(rest_model.ListRoutersEnvelope) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -103,7 +101,7 @@ func NewListTransitRoutersUnauthorized() *ListTransitRoutersUnauthorized { return &ListTransitRoutersUnauthorized{} } -/*ListTransitRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListTransitRoutersUnauthorized struct { 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 } diff --git a/rest_management_api_client/router/patch_router_parameters.go b/rest_management_api_client/router/patch_router_parameters.go new file mode 100644 index 000000000..0067ba4af --- /dev/null +++ b/rest_management_api_client/router/patch_router_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1e64cc446 --- /dev/null +++ b/rest_management_api_client/router/patch_router_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_client/transit_router/patch_transit_router_parameters.go b/rest_management_api_client/router/patch_transit_router_parameters.go similarity index 78% rename from rest_client/transit_router/patch_transit_router_parameters.go rename to rest_management_api_client/router/patch_transit_router_parameters.go index 30d8c3440..4eda83f5c 100644 --- a/rest_client/transit_router/patch_transit_router_parameters.go +++ b/rest_management_api_client/router/patch_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -42,66 +42,81 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchTransitRouterParams creates a new PatchTransitRouterParams object -// with the default values initialized. +// 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 { - var () return &PatchTransitRouterParams{ - timeout: cr.DefaultTimeout, } } // NewPatchTransitRouterParamsWithTimeout creates a new PatchTransitRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchTransitRouterParamsWithTimeout(timeout time.Duration) *PatchTransitRouterParams { - var () return &PatchTransitRouterParams{ - timeout: timeout, } } // NewPatchTransitRouterParamsWithContext creates a new PatchTransitRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchTransitRouterParamsWithContext(ctx context.Context) *PatchTransitRouterParams { - var () return &PatchTransitRouterParams{ - Context: ctx, } } // NewPatchTransitRouterParamsWithHTTPClient creates a new PatchTransitRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchTransitRouterParamsWithHTTPClient(client *http.Client) *PatchTransitRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Router - A transit router patch object + /* Router. + + A router patch object */ - Router *rest_model.TransitRouterPatch + 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) @@ -147,13 +162,13 @@ func (o *PatchTransitRouterParams) SetID(id string) { } // WithRouter adds the router to the patch transit router params -func (o *PatchTransitRouterParams) WithRouter(router *rest_model.TransitRouterPatch) *PatchTransitRouterParams { +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.TransitRouterPatch) { +func (o *PatchTransitRouterParams) SetRouter(router *rest_model.RouterPatch) { o.Router = router } @@ -169,7 +184,6 @@ func (o *PatchTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg s 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 diff --git a/rest_client/transit_router/patch_transit_router_responses.go b/rest_management_api_client/router/patch_transit_router_responses.go similarity index 93% rename from rest_client/transit_router/patch_transit_router_responses.go rename to rest_management_api_client/router/patch_transit_router_responses.go index e7e6cc292..9b4bbfd31 100644 --- a/rest_client/transit_router/patch_transit_router_responses.go +++ b/rest_management_api_client/router/patch_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -71,7 +71,6 @@ func (o *PatchTransitRouterReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -82,7 +81,7 @@ func NewPatchTransitRouterOK() *PatchTransitRouterOK { return &PatchTransitRouterOK{} } -/*PatchTransitRouterOK handles this case with default header values. +/* PatchTransitRouterOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchTransitRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchTransitRouterBadRequest() *PatchTransitRouterBadRequest { return &PatchTransitRouterBadRequest{} } -/*PatchTransitRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchTransitRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchTransitRouterUnauthorized() *PatchTransitRouterUnauthorized { return &PatchTransitRouterUnauthorized{} } -/*PatchTransitRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchTransitRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchTransitRouterNotFound() *PatchTransitRouterNotFound { return &PatchTransitRouterNotFound{} } -/*PatchTransitRouterNotFound handles this case with default header values. +/* PatchTransitRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchTransitRouterNotFound struct { 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 } diff --git a/rest_management_api_client/router/router_client.go b/rest_management_api_client/router/router_client.go new file mode 100644 index 000000000..c1782d76e --- /dev/null +++ b/rest_management_api_client/router/router_client.go @@ -0,0 +1,581 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c012f07ca --- /dev/null +++ b/rest_management_api_client/router/update_router_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..17de6dafc --- /dev/null +++ b/rest_management_api_client/router/update_router_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_client/transit_router/update_transit_router_parameters.go b/rest_management_api_client/router/update_transit_router_parameters.go similarity index 78% rename from rest_client/transit_router/update_transit_router_parameters.go rename to rest_management_api_client/router/update_transit_router_parameters.go index 090d7d4a4..8899b61f3 100644 --- a/rest_client/transit_router/update_transit_router_parameters.go +++ b/rest_management_api_client/router/update_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -42,66 +42,81 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateTransitRouterParams creates a new UpdateTransitRouterParams object -// with the default values initialized. +// 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 { - var () return &UpdateTransitRouterParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateTransitRouterParamsWithTimeout creates a new UpdateTransitRouterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateTransitRouterParamsWithTimeout(timeout time.Duration) *UpdateTransitRouterParams { - var () return &UpdateTransitRouterParams{ - timeout: timeout, } } // NewUpdateTransitRouterParamsWithContext creates a new UpdateTransitRouterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateTransitRouterParamsWithContext(ctx context.Context) *UpdateTransitRouterParams { - var () return &UpdateTransitRouterParams{ - Context: ctx, } } // NewUpdateTransitRouterParamsWithHTTPClient creates a new UpdateTransitRouterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateTransitRouterParamsWithHTTPClient(client *http.Client) *UpdateTransitRouterParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Router - A transit router update object + /* Router. + + A router update object */ - Router *rest_model.TransitRouterUpdate + 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) @@ -147,13 +162,13 @@ func (o *UpdateTransitRouterParams) SetID(id string) { } // WithRouter adds the router to the update transit router params -func (o *UpdateTransitRouterParams) WithRouter(router *rest_model.TransitRouterUpdate) *UpdateTransitRouterParams { +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.TransitRouterUpdate) { +func (o *UpdateTransitRouterParams) SetRouter(router *rest_model.RouterUpdate) { o.Router = router } @@ -169,7 +184,6 @@ func (o *UpdateTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg 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 diff --git a/rest_client/transit_router/update_transit_router_responses.go b/rest_management_api_client/router/update_transit_router_responses.go similarity index 93% rename from rest_client/transit_router/update_transit_router_responses.go rename to rest_management_api_client/router/update_transit_router_responses.go index e2a0438eb..f38b8e07a 100644 --- a/rest_client/transit_router/update_transit_router_responses.go +++ b/rest_management_api_client/router/update_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -71,7 +71,6 @@ func (o *UpdateTransitRouterReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -82,7 +81,7 @@ func NewUpdateTransitRouterOK() *UpdateTransitRouterOK { return &UpdateTransitRouterOK{} } -/*UpdateTransitRouterOK handles this case with default header values. +/* UpdateTransitRouterOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateTransitRouterOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateTransitRouterBadRequest() *UpdateTransitRouterBadRequest { return &UpdateTransitRouterBadRequest{} } -/*UpdateTransitRouterBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateTransitRouterBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateTransitRouterUnauthorized() *UpdateTransitRouterUnauthorized { return &UpdateTransitRouterUnauthorized{} } -/*UpdateTransitRouterUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateTransitRouterUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateTransitRouterNotFound() *UpdateTransitRouterNotFound { return &UpdateTransitRouterNotFound{} } -/*UpdateTransitRouterNotFound handles this case with default header values. +/* UpdateTransitRouterNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateTransitRouterNotFound struct { 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 } diff --git a/rest_client/service/create_service_parameters.go b/rest_management_api_client/service/create_service_parameters.go similarity index 79% rename from rest_client/service/create_service_parameters.go rename to rest_management_api_client/service/create_service_parameters.go index 6113ea6ea..a9b209f34 100644 --- a/rest_client/service/create_service_parameters.go +++ b/rest_management_api_client/service/create_service_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateServiceParams creates a new CreateServiceParams object -// with the default values initialized. +// 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 { - var () return &CreateServiceParams{ - timeout: cr.DefaultTimeout, } } // NewCreateServiceParamsWithTimeout creates a new CreateServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateServiceParamsWithTimeout(timeout time.Duration) *CreateServiceParams { - var () return &CreateServiceParams{ - timeout: timeout, } } // NewCreateServiceParamsWithContext creates a new CreateServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateServiceParamsWithContext(ctx context.Context) *CreateServiceParams { - var () return &CreateServiceParams{ - Context: ctx, } } // NewCreateServiceParamsWithHTTPClient creates a new CreateServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateServiceParamsWithHTTPClient(client *http.Client) *CreateServiceParams { - var () 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 +/* 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. + A service to create */ Service *rest_model.ServiceCreate @@ -97,6 +96,21 @@ type CreateServiceParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if o.Service != nil { if err := r.SetBodyParam(o.Service); err != nil { return err diff --git a/rest_client/service/create_service_responses.go b/rest_management_api_client/service/create_service_responses.go similarity index 94% rename from rest_client/service/create_service_responses.go rename to rest_management_api_client/service/create_service_responses.go index 272d1abc7..d6433f6f5 100644 --- a/rest_client/service/create_service_responses.go +++ b/rest_management_api_client/service/create_service_responses.go @@ -65,7 +65,6 @@ func (o *CreateServiceReader) ReadResponse(response runtime.ClientResponse, cons 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()) } @@ -76,7 +75,7 @@ func NewCreateServiceCreated() *CreateServiceCreated { return &CreateServiceCreated{} } -/*CreateServiceCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateServiceCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateServiceBadRequest() *CreateServiceBadRequest { return &CreateServiceBadRequest{} } -/*CreateServiceBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateServiceBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateServiceUnauthorized() *CreateServiceUnauthorized { return &CreateServiceUnauthorized{} } -/*CreateServiceUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateServiceUnauthorized struct { 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 } diff --git a/rest_management_api_client/service/delete_service_parameters.go b/rest_management_api_client/service/delete_service_parameters.go new file mode 100644 index 000000000..e4381338c --- /dev/null +++ b/rest_management_api_client/service/delete_service_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..329afe930 --- /dev/null +++ b/rest_management_api_client/service/delete_service_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..2b6d3bfc5 --- /dev/null +++ b/rest_management_api_client/service/detail_service_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..5e74205aa --- /dev/null +++ b/rest_management_api_client/service/detail_service_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/service/list_service_config_parameters.go b/rest_management_api_client/service/list_service_config_parameters.go similarity index 83% rename from rest_client/service/list_service_config_parameters.go rename to rest_management_api_client/service/list_service_config_parameters.go index 7a54c6875..6fd122604 100644 --- a/rest_client/service/list_service_config_parameters.go +++ b/rest_management_api_client/service/list_service_config_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceConfigParams creates a new ListServiceConfigParams object -// with the default values initialized. +// 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 { - var () return &ListServiceConfigParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceConfigParamsWithTimeout creates a new ListServiceConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceConfigParamsWithTimeout(timeout time.Duration) *ListServiceConfigParams { - var () return &ListServiceConfigParams{ - timeout: timeout, } } // NewListServiceConfigParamsWithContext creates a new ListServiceConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceConfigParamsWithContext(ctx context.Context) *ListServiceConfigParams { - var () return &ListServiceConfigParams{ - Context: ctx, } } // NewListServiceConfigParamsWithHTTPClient creates a new ListServiceConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceConfigParamsWithHTTPClient(client *http.Client) *ListServiceConfigParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceConfigParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceConfigParams) WriteToRequest(r runtime.ClientRequest, reg st // 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 @@ -212,32 +230,34 @@ func (o *ListServiceConfigParams) WriteToRequest(r runtime.ClientRequest, reg st // 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 { diff --git a/rest_client/service/list_service_config_responses.go b/rest_management_api_client/service/list_service_config_responses.go similarity index 95% rename from rest_client/service/list_service_config_responses.go rename to rest_management_api_client/service/list_service_config_responses.go index 10954dba3..c84d6cc07 100644 --- a/rest_client/service/list_service_config_responses.go +++ b/rest_management_api_client/service/list_service_config_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceConfigReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -70,7 +69,7 @@ func NewListServiceConfigOK() *ListServiceConfigOK { return &ListServiceConfigOK{} } -/*ListServiceConfigOK handles this case with default header values. +/* ListServiceConfigOK describes a response with status code 200, with default header values. A list of configs */ @@ -81,7 +80,6 @@ type ListServiceConfigOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceConfigUnauthorized() *ListServiceConfigUnauthorized { return &ListServiceConfigUnauthorized{} } -/*ListServiceConfigUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceConfigUnauthorized struct { 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 } diff --git a/rest_client/service/list_service_edge_routers_parameters.go b/rest_management_api_client/service/list_service_edge_routers_parameters.go similarity index 83% rename from rest_client/service/list_service_edge_routers_parameters.go rename to rest_management_api_client/service/list_service_edge_routers_parameters.go index 73a83e218..4248e90ff 100644 --- a/rest_client/service/list_service_edge_routers_parameters.go +++ b/rest_management_api_client/service/list_service_edge_routers_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceEdgeRoutersParams creates a new ListServiceEdgeRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListServiceEdgeRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceEdgeRoutersParamsWithTimeout creates a new ListServiceEdgeRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRoutersParams { - var () return &ListServiceEdgeRoutersParams{ - timeout: timeout, } } // NewListServiceEdgeRoutersParamsWithContext creates a new ListServiceEdgeRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceEdgeRoutersParamsWithContext(ctx context.Context) *ListServiceEdgeRoutersParams { - var () return &ListServiceEdgeRoutersParams{ - Context: ctx, } } // NewListServiceEdgeRoutersParamsWithHTTPClient creates a new ListServiceEdgeRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRoutersParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceEdgeRoutersParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, r // 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 @@ -212,32 +230,34 @@ func (o *ListServiceEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, r // 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 { diff --git a/rest_client/service/list_service_edge_routers_responses.go b/rest_management_api_client/service/list_service_edge_routers_responses.go similarity index 95% rename from rest_client/service/list_service_edge_routers_responses.go rename to rest_management_api_client/service/list_service_edge_routers_responses.go index dfded8917..0e6309337 100644 --- a/rest_client/service/list_service_edge_routers_responses.go +++ b/rest_management_api_client/service/list_service_edge_routers_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceEdgeRoutersReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -70,7 +69,7 @@ func NewListServiceEdgeRoutersOK() *ListServiceEdgeRoutersOK { return &ListServiceEdgeRoutersOK{} } -/*ListServiceEdgeRoutersOK handles this case with default header values. +/* ListServiceEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -81,7 +80,6 @@ type ListServiceEdgeRoutersOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceEdgeRoutersUnauthorized() *ListServiceEdgeRoutersUnauthorized return &ListServiceEdgeRoutersUnauthorized{} } -/*ListServiceEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceEdgeRoutersUnauthorized struct { 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 } diff --git a/rest_client/service/list_service_identities_parameters.go b/rest_management_api_client/service/list_service_identities_parameters.go similarity index 83% rename from rest_client/service/list_service_identities_parameters.go rename to rest_management_api_client/service/list_service_identities_parameters.go index df0e0f860..476f2878a 100644 --- a/rest_client/service/list_service_identities_parameters.go +++ b/rest_management_api_client/service/list_service_identities_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceIdentitiesParams creates a new ListServiceIdentitiesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceIdentitiesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceIdentitiesParamsWithTimeout creates a new ListServiceIdentitiesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceIdentitiesParamsWithTimeout(timeout time.Duration) *ListServiceIdentitiesParams { - var () return &ListServiceIdentitiesParams{ - timeout: timeout, } } // NewListServiceIdentitiesParamsWithContext creates a new ListServiceIdentitiesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceIdentitiesParamsWithContext(ctx context.Context) *ListServiceIdentitiesParams { - var () return &ListServiceIdentitiesParams{ - Context: ctx, } } // NewListServiceIdentitiesParamsWithHTTPClient creates a new ListServiceIdentitiesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceIdentitiesParamsWithHTTPClient(client *http.Client) *ListServiceIdentitiesParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceIdentitiesParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceIdentitiesParams) WriteToRequest(r runtime.ClientRequest, re // 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 @@ -212,32 +230,34 @@ func (o *ListServiceIdentitiesParams) WriteToRequest(r runtime.ClientRequest, re // 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 { diff --git a/rest_client/service/list_service_identities_responses.go b/rest_management_api_client/service/list_service_identities_responses.go similarity index 95% rename from rest_client/service/list_service_identities_responses.go rename to rest_management_api_client/service/list_service_identities_responses.go index 4a3dcbd8c..23e2755e6 100644 --- a/rest_client/service/list_service_identities_responses.go +++ b/rest_management_api_client/service/list_service_identities_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceIdentitiesReader) ReadResponse(response runtime.ClientRespon 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()) } @@ -70,7 +69,7 @@ func NewListServiceIdentitiesOK() *ListServiceIdentitiesOK { return &ListServiceIdentitiesOK{} } -/*ListServiceIdentitiesOK handles this case with default header values. +/* ListServiceIdentitiesOK describes a response with status code 200, with default header values. A list of identities */ @@ -81,7 +80,6 @@ type ListServiceIdentitiesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceIdentitiesUnauthorized() *ListServiceIdentitiesUnauthorized { return &ListServiceIdentitiesUnauthorized{} } -/*ListServiceIdentitiesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceIdentitiesUnauthorized struct { 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 } diff --git a/rest_client/service/list_service_service_edge_router_policies_parameters.go b/rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go similarity index 83% rename from rest_client/service/list_service_service_edge_router_policies_parameters.go rename to rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go index 26b3133e6..040b414c7 100644 --- a/rest_client/service/list_service_service_edge_router_policies_parameters.go +++ b/rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceServiceEdgeRouterPoliciesParams creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListServiceServiceEdgeRouterPoliciesParams { - var () return &ListServiceServiceEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListServiceServiceEdgeRouterPoliciesParamsWithContext creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListServiceServiceEdgeRouterPoliciesParams { - var () return &ListServiceServiceEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListServiceServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListServiceServiceEdgeRouterPoliciesParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceServiceEdgeRouterPoliciesParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.Cl // 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 @@ -212,32 +230,34 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.Cl // 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 { diff --git a/rest_client/service/list_service_service_edge_router_policies_responses.go b/rest_management_api_client/service/list_service_service_edge_router_policies_responses.go similarity index 95% rename from rest_client/service/list_service_service_edge_router_policies_responses.go rename to rest_management_api_client/service/list_service_service_edge_router_policies_responses.go index 66a88e567..8ba9e81d5 100644 --- a/rest_client/service/list_service_service_edge_router_policies_responses.go +++ b/rest_management_api_client/service/list_service_service_edge_router_policies_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceServiceEdgeRouterPoliciesReader) ReadResponse(response runti 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()) } @@ -70,7 +69,7 @@ func NewListServiceServiceEdgeRouterPoliciesOK() *ListServiceServiceEdgeRouterPo return &ListServiceServiceEdgeRouterPoliciesOK{} } -/*ListServiceServiceEdgeRouterPoliciesOK handles this case with default header values. +/* ListServiceServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of service edge router policies */ @@ -81,7 +80,6 @@ type ListServiceServiceEdgeRouterPoliciesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceServiceEdgeRouterPoliciesUnauthorized() *ListServiceServiceEd return &ListServiceServiceEdgeRouterPoliciesUnauthorized{} } -/*ListServiceServiceEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceServiceEdgeRouterPoliciesUnauthorized struct { 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 } diff --git a/rest_client/service/list_service_service_policies_parameters.go b/rest_management_api_client/service/list_service_service_policies_parameters.go similarity index 83% rename from rest_client/service/list_service_service_policies_parameters.go rename to rest_management_api_client/service/list_service_service_policies_parameters.go index 5e0c9baa0..5f75fada9 100644 --- a/rest_client/service/list_service_service_policies_parameters.go +++ b/rest_management_api_client/service/list_service_service_policies_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceServicePoliciesParams creates a new ListServiceServicePoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceServicePoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceServicePoliciesParamsWithTimeout creates a new ListServiceServicePoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceServicePoliciesParamsWithTimeout(timeout time.Duration) *ListServiceServicePoliciesParams { - var () return &ListServiceServicePoliciesParams{ - timeout: timeout, } } // NewListServiceServicePoliciesParamsWithContext creates a new ListServiceServicePoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceServicePoliciesParamsWithContext(ctx context.Context) *ListServiceServicePoliciesParams { - var () return &ListServiceServicePoliciesParams{ - Context: ctx, } } // NewListServiceServicePoliciesParamsWithHTTPClient creates a new ListServiceServicePoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceServicePoliciesParamsWithHTTPClient(client *http.Client) *ListServiceServicePoliciesParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServiceServicePoliciesParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServiceServicePoliciesParams) WriteToRequest(r runtime.ClientReques // 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 @@ -212,32 +230,34 @@ func (o *ListServiceServicePoliciesParams) WriteToRequest(r runtime.ClientReques // 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 { diff --git a/rest_client/service/list_service_service_policies_responses.go b/rest_management_api_client/service/list_service_service_policies_responses.go similarity index 95% rename from rest_client/service/list_service_service_policies_responses.go rename to rest_management_api_client/service/list_service_service_policies_responses.go index d030e4723..3b2b5fc41 100644 --- a/rest_client/service/list_service_service_policies_responses.go +++ b/rest_management_api_client/service/list_service_service_policies_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceServicePoliciesReader) ReadResponse(response runtime.ClientR 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()) } @@ -70,7 +69,7 @@ func NewListServiceServicePoliciesOK() *ListServiceServicePoliciesOK { return &ListServiceServicePoliciesOK{} } -/*ListServiceServicePoliciesOK handles this case with default header values. +/* ListServiceServicePoliciesOK describes a response with status code 200, with default header values. A list of service policies */ @@ -81,7 +80,6 @@ type ListServiceServicePoliciesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceServicePoliciesUnauthorized() *ListServiceServicePoliciesUnau return &ListServiceServicePoliciesUnauthorized{} } -/*ListServiceServicePoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceServicePoliciesUnauthorized struct { 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 } diff --git a/rest_management_api_client/service/list_service_terminators_parameters.go b/rest_management_api_client/service/list_service_terminators_parameters.go new file mode 100644 index 000000000..61702324d --- /dev/null +++ b/rest_management_api_client/service/list_service_terminators_parameters.go @@ -0,0 +1,267 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/service/list_service_terminators_responses.go b/rest_management_api_client/service/list_service_terminators_responses.go similarity index 95% rename from rest_client/service/list_service_terminators_responses.go rename to rest_management_api_client/service/list_service_terminators_responses.go index d18de383a..3a63ab437 100644 --- a/rest_client/service/list_service_terminators_responses.go +++ b/rest_management_api_client/service/list_service_terminators_responses.go @@ -59,7 +59,6 @@ func (o *ListServiceTerminatorsReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -70,7 +69,7 @@ func NewListServiceTerminatorsOK() *ListServiceTerminatorsOK { return &ListServiceTerminatorsOK{} } -/*ListServiceTerminatorsOK handles this case with default header values. +/* ListServiceTerminatorsOK describes a response with status code 200, with default header values. A list of terminators */ @@ -81,7 +80,6 @@ type ListServiceTerminatorsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceTerminatorsUnauthorized() *ListServiceTerminatorsUnauthorized return &ListServiceTerminatorsUnauthorized{} } -/*ListServiceTerminatorsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceTerminatorsUnauthorized struct { 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 } diff --git a/rest_management_api_client/service/list_services_parameters.go b/rest_management_api_client/service/list_services_parameters.go new file mode 100644 index 000000000..84c5ff824 --- /dev/null +++ b/rest_management_api_client/service/list_services_parameters.go @@ -0,0 +1,318 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/geo_region/list_geo_regions_responses.go b/rest_management_api_client/service/list_services_responses.go similarity index 58% rename from rest_client/geo_region/list_geo_regions_responses.go rename to rest_management_api_client/service/list_services_responses.go index 63a3ab97d..f376ad677 100644 --- a/rest_client/geo_region/list_geo_regions_responses.go +++ b/rest_management_api_client/service/list_services_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package service // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -39,56 +39,54 @@ import ( "github.com/openziti/edge/rest_model" ) -// ListGeoRegionsReader is a Reader for the ListGeoRegions structure. -type ListGeoRegionsReader struct { +// 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 *ListGeoRegionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewListGeoRegionsOK() + result := NewListServicesOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: - result := NewListGeoRegionsUnauthorized() + 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()) } } -// NewListGeoRegionsOK creates a ListGeoRegionsOK with default headers values -func NewListGeoRegionsOK() *ListGeoRegionsOK { - return &ListGeoRegionsOK{} +// NewListServicesOK creates a ListServicesOK with default headers values +func NewListServicesOK() *ListServicesOK { + return &ListServicesOK{} } -/*ListGeoRegionsOK handles this case with default header values. +/* ListServicesOK describes a response with status code 200, with default header values. -A list of geo-regions +A list of services */ -type ListGeoRegionsOK struct { - Payload *rest_model.ListGeoRegionsEnvelope +type ListServicesOK struct { + Payload *rest_model.ListServicesEnvelope } -func (o *ListGeoRegionsOK) Error() string { - return fmt.Sprintf("[GET /geo-regions][%d] listGeoRegionsOK %+v", 200, o.Payload) +func (o *ListServicesOK) Error() string { + return fmt.Sprintf("[GET /services][%d] listServicesOK %+v", 200, o.Payload) } - -func (o *ListGeoRegionsOK) GetPayload() *rest_model.ListGeoRegionsEnvelope { +func (o *ListServicesOK) GetPayload() *rest_model.ListServicesEnvelope { return o.Payload } -func (o *ListGeoRegionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(rest_model.ListGeoRegionsEnvelope) + o.Payload = new(rest_model.ListServicesEnvelope) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -98,28 +96,27 @@ func (o *ListGeoRegionsOK) readResponse(response runtime.ClientResponse, consume return nil } -// NewListGeoRegionsUnauthorized creates a ListGeoRegionsUnauthorized with default headers values -func NewListGeoRegionsUnauthorized() *ListGeoRegionsUnauthorized { - return &ListGeoRegionsUnauthorized{} +// NewListServicesUnauthorized creates a ListServicesUnauthorized with default headers values +func NewListServicesUnauthorized() *ListServicesUnauthorized { + return &ListServicesUnauthorized{} } -/*ListGeoRegionsUnauthorized handles this case with default header values. +/* 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 ListGeoRegionsUnauthorized struct { +type ListServicesUnauthorized struct { Payload *rest_model.APIErrorEnvelope } -func (o *ListGeoRegionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /geo-regions][%d] listGeoRegionsUnauthorized %+v", 401, o.Payload) +func (o *ListServicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /services][%d] listServicesUnauthorized %+v", 401, o.Payload) } - -func (o *ListGeoRegionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { +func (o *ListServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { return o.Payload } -func (o *ListGeoRegionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(rest_model.APIErrorEnvelope) diff --git a/rest_management_api_client/service/patch_service_parameters.go b/rest_management_api_client/service/patch_service_parameters.go new file mode 100644 index 000000000..7b024e750 --- /dev/null +++ b/rest_management_api_client/service/patch_service_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..799bc869e --- /dev/null +++ b/rest_management_api_client/service/patch_service_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/service/service_client.go b/rest_management_api_client/service/service_client.go similarity index 83% rename from rest_client/service/service_client.go rename to rest_management_api_client/service/service_client.go index f48344709..5ca834451 100644 --- a/rest_client/service/service_client.go +++ b/rest_management_api_client/service/service_client.go @@ -49,31 +49,34 @@ type Client struct { 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) (*CreateServiceCreated, error) + CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) - DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServiceOK, error) + DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) - DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServiceOK, error) + DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) - ListServiceConfig(params *ListServiceConfigParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceConfigOK, error) + ListServiceConfig(params *ListServiceConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceConfigOK, error) - ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRoutersOK, error) + ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRoutersOK, error) - ListServiceIdentities(params *ListServiceIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceIdentitiesOK, error) + ListServiceIdentities(params *ListServiceIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceIdentitiesOK, error) - ListServiceServiceEdgeRouterPolicies(params *ListServiceServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceServiceEdgeRouterPoliciesOK, error) + ListServiceServiceEdgeRouterPolicies(params *ListServiceServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServiceEdgeRouterPoliciesOK, error) - ListServiceServicePolicies(params *ListServiceServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceServicePoliciesOK, error) + ListServiceServicePolicies(params *ListServiceServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServicePoliciesOK, error) - ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceTerminatorsOK, error) + ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) - ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicesOK, error) + ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) - PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServiceOK, error) + PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) - UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServiceOK, error) + UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) SetTransport(transport runtime.ClientTransport) } @@ -83,13 +86,12 @@ type ClientService interface { Create a services resource. Requires admin access. */ -func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter) (*CreateServiceCreated, error) { +func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createService", Method: "POST", PathPattern: "/services", @@ -101,7 +103,12 @@ func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.Cli 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 } @@ -120,13 +127,12 @@ func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.Cli Delete a service by id. Requires admin access. */ -func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServiceOK, error) { +func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteService", Method: "DELETE", PathPattern: "/services/{id}", @@ -138,7 +144,12 @@ func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.Cli 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 } @@ -157,13 +168,12 @@ func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.Cli Retrieves a single service by id. Requires admin access. */ -func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServiceOK, error) { +func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailService", Method: "GET", PathPattern: "/services/{id}", @@ -175,7 +185,12 @@ func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.Cli 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 } @@ -195,13 +210,12 @@ func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.Cli 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) (*ListServiceConfigOK, error) { +func (a *Client) ListServiceConfig(params *ListServiceConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceConfig", Method: "GET", PathPattern: "/services/{id}/configs", @@ -213,7 +227,12 @@ func (a *Client) ListServiceConfig(params *ListServiceConfigParams, authInfo run 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 } @@ -233,13 +252,12 @@ func (a *Client) ListServiceConfig(params *ListServiceConfigParams, authInfo run 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) (*ListServiceEdgeRoutersOK, error) { +func (a *Client) ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceEdgeRouters", Method: "GET", PathPattern: "/services/{id}/edge-routers", @@ -251,7 +269,12 @@ func (a *Client) ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, au 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 } @@ -271,13 +294,12 @@ func (a *Client) ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, au 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) (*ListServiceIdentitiesOK, error) { +func (a *Client) ListServiceIdentities(params *ListServiceIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceIdentitiesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceIdentities", Method: "GET", PathPattern: "/services/{id}/identities", @@ -289,7 +311,12 @@ func (a *Client) ListServiceIdentities(params *ListServiceIdentitiesParams, auth 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 } @@ -309,13 +336,12 @@ func (a *Client) ListServiceIdentities(params *ListServiceIdentitiesParams, auth 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) (*ListServiceServiceEdgeRouterPoliciesOK, error) { +func (a *Client) ListServiceServiceEdgeRouterPolicies(params *ListServiceServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServiceEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceServiceEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceServiceEdgeRouterPolicies", Method: "GET", PathPattern: "/services/{id}/service-edge-router-policies", @@ -327,7 +353,12 @@ func (a *Client) ListServiceServiceEdgeRouterPolicies(params *ListServiceService 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 } @@ -347,13 +378,12 @@ func (a *Client) ListServiceServiceEdgeRouterPolicies(params *ListServiceService 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) (*ListServiceServicePoliciesOK, error) { +func (a *Client) ListServiceServicePolicies(params *ListServiceServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServicePoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceServicePoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceServicePolicies", Method: "GET", PathPattern: "/services/{id}/service-policies", @@ -365,7 +395,12 @@ func (a *Client) ListServiceServicePolicies(params *ListServiceServicePoliciesPa 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 } @@ -385,13 +420,12 @@ func (a *Client) ListServiceServicePolicies(params *ListServiceServicePoliciesPa 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) (*ListServiceTerminatorsOK, error) { +func (a *Client) ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceTerminatorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceTerminators", Method: "GET", PathPattern: "/services/{id}/terminators", @@ -403,7 +437,12 @@ func (a *Client) ListServiceTerminators(params *ListServiceTerminatorsParams, au 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 } @@ -423,13 +462,12 @@ func (a *Client) ListServiceTerminators(params *ListServiceTerminatorsParams, au Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicesOK, error) { +func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServices", Method: "GET", PathPattern: "/services", @@ -441,7 +479,12 @@ func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.Clien 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 } @@ -460,13 +503,12 @@ func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.Clien Update the supplied fields on a service. Requires admin access. */ -func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServiceOK, error) { +func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchService", Method: "PATCH", PathPattern: "/services/{id}", @@ -478,7 +520,12 @@ func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.Clien 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 } @@ -497,13 +544,12 @@ func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.Clien Update all fields on a service by id. Requires admin access. */ -func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServiceOK, error) { +func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateService", Method: "PUT", PathPattern: "/services/{id}", @@ -515,7 +561,12 @@ func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.Cli 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 } diff --git a/rest_management_api_client/service/update_service_parameters.go b/rest_management_api_client/service/update_service_parameters.go new file mode 100644 index 000000000..db16242d8 --- /dev/null +++ b/rest_management_api_client/service/update_service_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..075c3ecdd --- /dev/null +++ b/rest_management_api_client/service/update_service_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/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 similarity index 79% rename from rest_client/service_edge_router_policy/create_service_edge_router_policy_parameters.go rename to rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_parameters.go index fe0a5419a..5f0ea2596 100644 --- a/rest_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 @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateServiceEdgeRouterPolicyParams creates a new CreateServiceEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &CreateServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewCreateServiceEdgeRouterPolicyParamsWithTimeout creates a new CreateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *CreateServiceEdgeRouterPolicyParams { - var () return &CreateServiceEdgeRouterPolicyParams{ - timeout: timeout, } } // NewCreateServiceEdgeRouterPolicyParamsWithContext creates a new CreateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *CreateServiceEdgeRouterPolicyParams { - var () return &CreateServiceEdgeRouterPolicyParams{ - Context: ctx, } } // NewCreateServiceEdgeRouterPolicyParamsWithHTTPClient creates a new CreateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *CreateServiceEdgeRouterPolicyParams { - var () 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 +/* 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. + A service edge router policy to create */ Policy *rest_model.ServiceEdgeRouterPolicyCreate @@ -97,6 +96,21 @@ type CreateServiceEdgeRouterPolicyParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientReq return err } var res []error - if o.Policy != nil { if err := r.SetBodyParam(o.Policy); err != nil { return err diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/create_service_edge_router_policy_responses.go rename to rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_responses.go index ecf1f91e2..b9fd0a272 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *CreateServiceEdgeRouterPolicyReader) ReadResponse(response runtime.Clie 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()) } @@ -76,7 +75,7 @@ func NewCreateServiceEdgeRouterPolicyCreated() *CreateServiceEdgeRouterPolicyCre return &CreateServiceEdgeRouterPolicyCreated{} } -/*CreateServiceEdgeRouterPolicyCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateServiceEdgeRouterPolicyCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateServiceEdgeRouterPolicyBadRequest() *CreateServiceEdgeRouterPolicy return &CreateServiceEdgeRouterPolicyBadRequest{} } -/*CreateServiceEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateServiceEdgeRouterPolicyBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateServiceEdgeRouterPolicyUnauthorized() *CreateServiceEdgeRouterPoli return &CreateServiceEdgeRouterPolicyUnauthorized{} } -/*CreateServiceEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateServiceEdgeRouterPolicyUnauthorized struct { 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/service_edge_router_policy/delete_service_edge_router_policy_parameters.go rename to rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_parameters.go index d65c46960..c0ff7c9de 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteServiceEdgeRouterPolicyParams creates a new DeleteServiceEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &DeleteServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteServiceEdgeRouterPolicyParamsWithTimeout creates a new DeleteServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DeleteServiceEdgeRouterPolicyParams { - var () return &DeleteServiceEdgeRouterPolicyParams{ - timeout: timeout, } } // NewDeleteServiceEdgeRouterPolicyParamsWithContext creates a new DeleteServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *DeleteServiceEdgeRouterPolicyParams { - var () return &DeleteServiceEdgeRouterPolicyParams{ - Context: ctx, } } // NewDeleteServiceEdgeRouterPolicyParamsWithHTTPClient creates a new DeleteServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DeleteServiceEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteServiceEdgeRouterPolicyParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/delete_service_edge_router_policy_responses.go rename to rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_responses.go index 8c22ec257..3cc50de33 100644 --- a/rest_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 @@ -71,7 +71,6 @@ func (o *DeleteServiceEdgeRouterPolicyReader) ReadResponse(response runtime.Clie 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()) } @@ -82,7 +81,7 @@ func NewDeleteServiceEdgeRouterPolicyOK() *DeleteServiceEdgeRouterPolicyOK { return &DeleteServiceEdgeRouterPolicyOK{} } -/*DeleteServiceEdgeRouterPolicyOK handles this case with default header values. +/* DeleteServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteServiceEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteServiceEdgeRouterPolicyBadRequest() *DeleteServiceEdgeRouterPolicy return &DeleteServiceEdgeRouterPolicyBadRequest{} } -/*DeleteServiceEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteServiceEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteServiceEdgeRouterPolicyUnauthorized() *DeleteServiceEdgeRouterPoli return &DeleteServiceEdgeRouterPolicyUnauthorized{} } -/*DeleteServiceEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteServiceEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteServiceEdgeRouterPolicyConflict() *DeleteServiceEdgeRouterPolicyCo return &DeleteServiceEdgeRouterPolicyConflict{} } -/*DeleteServiceEdgeRouterPolicyConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteServiceEdgeRouterPolicyConflict struct { 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 } diff --git a/rest_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 similarity index 78% rename from rest_client/service_edge_router_policy/detail_service_edge_router_policy_parameters.go rename to rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_parameters.go index 62fce724f..5db15d1b8 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailServiceEdgeRouterPolicyParams creates a new DetailServiceEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &DetailServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDetailServiceEdgeRouterPolicyParamsWithTimeout creates a new DetailServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DetailServiceEdgeRouterPolicyParams { - var () return &DetailServiceEdgeRouterPolicyParams{ - timeout: timeout, } } // NewDetailServiceEdgeRouterPolicyParamsWithContext creates a new DetailServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *DetailServiceEdgeRouterPolicyParams { - var () return &DetailServiceEdgeRouterPolicyParams{ - Context: ctx, } } // NewDetailServiceEdgeRouterPolicyParamsWithHTTPClient creates a new DetailServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DetailServiceEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailServiceEdgeRouterPolicyParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/detail_service_edge_router_policy_responses.go rename to rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_responses.go index 06982bac9..78aa4f0a8 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *DetailServiceEdgeRouterPolicyReader) ReadResponse(response runtime.Clie 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()) } @@ -76,7 +75,7 @@ func NewDetailServiceEdgeRouterPolicyOK() *DetailServiceEdgeRouterPolicyOK { return &DetailServiceEdgeRouterPolicyOK{} } -/*DetailServiceEdgeRouterPolicyOK handles this case with default header values. +/* DetailServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. A single service edge router policy */ @@ -87,7 +86,6 @@ type DetailServiceEdgeRouterPolicyOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailServiceEdgeRouterPolicyUnauthorized() *DetailServiceEdgeRouterPoli return &DetailServiceEdgeRouterPolicyUnauthorized{} } -/*DetailServiceEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailServiceEdgeRouterPolicyUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailServiceEdgeRouterPolicyNotFound() *DetailServiceEdgeRouterPolicyNo return &DetailServiceEdgeRouterPolicyNotFound{} } -/*DetailServiceEdgeRouterPolicyNotFound handles this case with default header values. +/* DetailServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailServiceEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_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 similarity index 83% rename from rest_client/service_edge_router_policy/list_service_edge_router_policies_parameters.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_parameters.go index 1e669e0e6..ba52bea55 100644 --- a/rest_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 @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListServiceEdgeRouterPoliciesParams creates a new ListServiceEdgeRouterPoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPoliciesParams { - var () return &ListServiceEdgeRouterPoliciesParams{ - timeout: timeout, } } // NewListServiceEdgeRouterPoliciesParamsWithContext creates a new ListServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPoliciesParams { - var () return &ListServiceEdgeRouterPoliciesParams{ - Context: ctx, } } // NewListServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListServiceEdgeRouterPoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPoliciesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListServiceEdgeRouterPoliciesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientReq // 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 { diff --git a/rest_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 similarity index 95% rename from rest_client/service_edge_router_policy/list_service_edge_router_policies_responses.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_responses.go index 7d936644f..090a66cd2 100644 --- a/rest_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 @@ -59,7 +59,6 @@ func (o *ListServiceEdgeRouterPoliciesReader) ReadResponse(response runtime.Clie 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()) } @@ -70,7 +69,7 @@ func NewListServiceEdgeRouterPoliciesOK() *ListServiceEdgeRouterPoliciesOK { return &ListServiceEdgeRouterPoliciesOK{} } -/*ListServiceEdgeRouterPoliciesOK handles this case with default header values. +/* ListServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. A list of service edge router policies */ @@ -81,7 +80,6 @@ type ListServiceEdgeRouterPoliciesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServiceEdgeRouterPoliciesUnauthorized() *ListServiceEdgeRouterPolici return &ListServiceEdgeRouterPoliciesUnauthorized{} } -/*ListServiceEdgeRouterPoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServiceEdgeRouterPoliciesUnauthorized struct { 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 } diff --git a/rest_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 similarity index 79% rename from rest_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go index d0a9c62a6..d2dbc6646 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListServiceEdgeRouterPolicyEdgeRoutersParams creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized. +// 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 { - var () return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithTimeout creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - var () return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - timeout: timeout, } } // NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithContext creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - var () return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - Context: ctx, } } // NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListServiceEdgeRouterPolicyEdgeRoutersParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go index 3cd41514d..3db10871c 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListServiceEdgeRouterPolicyEdgeRoutersReader) ReadResponse(response run 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()) } @@ -76,7 +75,7 @@ func NewListServiceEdgeRouterPolicyEdgeRoutersOK() *ListServiceEdgeRouterPolicyE return &ListServiceEdgeRouterPolicyEdgeRoutersOK{} } -/*ListServiceEdgeRouterPolicyEdgeRoutersOK handles this case with default header values. +/* ListServiceEdgeRouterPolicyEdgeRoutersOK describes a response with status code 200, with default header values. A list of edge routers */ @@ -87,7 +86,6 @@ type ListServiceEdgeRouterPolicyEdgeRoutersOK struct { 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 } @@ -109,7 +107,7 @@ func NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized() *ListServiceEdgeRou return &ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized{} } -/*ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListServiceEdgeRouterPolicyEdgeRoutersNotFound() *ListServiceEdgeRouterP return &ListServiceEdgeRouterPolicyEdgeRoutersNotFound{} } -/*ListServiceEdgeRouterPolicyEdgeRoutersNotFound handles this case with default header values. +/* ListServiceEdgeRouterPolicyEdgeRoutersNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListServiceEdgeRouterPolicyEdgeRoutersNotFound struct { 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 } diff --git a/rest_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 similarity index 79% rename from rest_client/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go index 1839007df..522be37f5 100644 --- a/rest_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 @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListServiceEdgeRouterPolicyServicesParams creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the default values initialized. +// 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 { - var () return &ListServiceEdgeRouterPolicyServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListServiceEdgeRouterPolicyServicesParamsWithTimeout creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServiceEdgeRouterPolicyServicesParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyServicesParams { - var () return &ListServiceEdgeRouterPolicyServicesParams{ - timeout: timeout, } } // NewListServiceEdgeRouterPolicyServicesParamsWithContext creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServiceEdgeRouterPolicyServicesParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPolicyServicesParams { - var () return &ListServiceEdgeRouterPolicyServicesParams{ - Context: ctx, } } // NewListServiceEdgeRouterPolicyServicesParamsWithHTTPClient creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServiceEdgeRouterPolicyServicesParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyServicesParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type ListServiceEdgeRouterPolicyServicesParams struct { 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) diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/list_service_edge_router_policy_services_responses.go rename to rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_responses.go index ea043042f..d4417ffb7 100644 --- a/rest_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 @@ -65,7 +65,6 @@ func (o *ListServiceEdgeRouterPolicyServicesReader) ReadResponse(response runtim 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()) } @@ -76,7 +75,7 @@ func NewListServiceEdgeRouterPolicyServicesOK() *ListServiceEdgeRouterPolicyServ return &ListServiceEdgeRouterPolicyServicesOK{} } -/*ListServiceEdgeRouterPolicyServicesOK handles this case with default header values. +/* ListServiceEdgeRouterPolicyServicesOK describes a response with status code 200, with default header values. A list of services */ @@ -87,7 +86,6 @@ type ListServiceEdgeRouterPolicyServicesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListServiceEdgeRouterPolicyServicesUnauthorized() *ListServiceEdgeRouter return &ListServiceEdgeRouterPolicyServicesUnauthorized{} } -/*ListServiceEdgeRouterPolicyServicesUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type ListServiceEdgeRouterPolicyServicesUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewListServiceEdgeRouterPolicyServicesNotFound() *ListServiceEdgeRouterPoli return &ListServiceEdgeRouterPolicyServicesNotFound{} } -/*ListServiceEdgeRouterPolicyServicesNotFound handles this case with default header values. +/* ListServiceEdgeRouterPolicyServicesNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type ListServiceEdgeRouterPolicyServicesNotFound struct { 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 } diff --git a/rest_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 similarity index 80% rename from rest_client/service_edge_router_policy/patch_service_edge_router_policy_parameters.go rename to rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_parameters.go index 44eeac972..e1ef4fdc7 100644 --- a/rest_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 @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchServiceEdgeRouterPolicyParams creates a new PatchServiceEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &PatchServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewPatchServiceEdgeRouterPolicyParamsWithTimeout creates a new PatchServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *PatchServiceEdgeRouterPolicyParams { - var () return &PatchServiceEdgeRouterPolicyParams{ - timeout: timeout, } } // NewPatchServiceEdgeRouterPolicyParamsWithContext creates a new PatchServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *PatchServiceEdgeRouterPolicyParams { - var () return &PatchServiceEdgeRouterPolicyParams{ - Context: ctx, } } // NewPatchServiceEdgeRouterPolicyParamsWithHTTPClient creates a new PatchServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *PatchServiceEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - A service edge router policy patch object + /* Policy. + + A service edge router policy patch object */ Policy *rest_model.ServiceEdgeRouterPolicyPatch @@ -102,6 +102,21 @@ type PatchServiceEdgeRouterPolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequ 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 diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/patch_service_edge_router_policy_responses.go rename to rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_responses.go index c14f37707..d305e3f50 100644 --- a/rest_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 @@ -71,7 +71,6 @@ func (o *PatchServiceEdgeRouterPolicyReader) ReadResponse(response runtime.Clien 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()) } @@ -82,7 +81,7 @@ func NewPatchServiceEdgeRouterPolicyOK() *PatchServiceEdgeRouterPolicyOK { return &PatchServiceEdgeRouterPolicyOK{} } -/*PatchServiceEdgeRouterPolicyOK handles this case with default header values. +/* PatchServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchServiceEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchServiceEdgeRouterPolicyBadRequest() *PatchServiceEdgeRouterPolicyBa return &PatchServiceEdgeRouterPolicyBadRequest{} } -/*PatchServiceEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchServiceEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchServiceEdgeRouterPolicyUnauthorized() *PatchServiceEdgeRouterPolicy return &PatchServiceEdgeRouterPolicyUnauthorized{} } -/*PatchServiceEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchServiceEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchServiceEdgeRouterPolicyNotFound() *PatchServiceEdgeRouterPolicyNotF return &PatchServiceEdgeRouterPolicyNotFound{} } -/*PatchServiceEdgeRouterPolicyNotFound handles this case with default header values. +/* PatchServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchServiceEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_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 similarity index 84% rename from rest_client/service_edge_router_policy/service_edge_router_policy_client.go rename to rest_management_api_client/service_edge_router_policy/service_edge_router_policy_client.go index ed71f87e7..6cfac3e09 100644 --- a/rest_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 @@ -49,23 +49,26 @@ type Client struct { 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) (*CreateServiceEdgeRouterPolicyCreated, error) + CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceEdgeRouterPolicyCreated, error) - DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServiceEdgeRouterPolicyOK, error) + DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceEdgeRouterPolicyOK, error) - DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServiceEdgeRouterPolicyOK, error) + DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceEdgeRouterPolicyOK, error) - ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRouterPoliciesOK, error) + ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPoliciesOK, error) - ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) + ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) - ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRouterPolicyServicesOK, error) + ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyServicesOK, error) - PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServiceEdgeRouterPolicyOK, error) + PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceEdgeRouterPolicyOK, error) - UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServiceEdgeRouterPolicyOK, error) + UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceEdgeRouterPolicyOK, error) SetTransport(transport runtime.ClientTransport) } @@ -75,13 +78,12 @@ type ClientService interface { Create a service edge router policy resource. Requires admin access. */ -func (a *Client) CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateServiceEdgeRouterPolicyCreated, error) { +func (a *Client) CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceEdgeRouterPolicyCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateServiceEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createServiceEdgeRouterPolicy", Method: "POST", PathPattern: "/service-edge-router-policies", @@ -93,7 +95,12 @@ func (a *Client) CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPo 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 } @@ -112,13 +119,12 @@ func (a *Client) CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPo Delete a service edge policy by id. Requires admin access. */ -func (a *Client) DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServiceEdgeRouterPolicyOK, error) { +func (a *Client) DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteServiceEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteServiceEdgeRouterPolicy", Method: "DELETE", PathPattern: "/service-edge-router-policies/{id}", @@ -130,7 +136,12 @@ func (a *Client) DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPo 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 } @@ -149,13 +160,12 @@ func (a *Client) DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPo Retrieves a single service edge policy by id. Requires admin access. */ -func (a *Client) DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServiceEdgeRouterPolicyOK, error) { +func (a *Client) DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailServiceEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailServiceEdgeRouterPolicy", Method: "GET", PathPattern: "/service-edge-router-policies/{id}", @@ -167,7 +177,12 @@ func (a *Client) DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPo 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 } @@ -187,13 +202,12 @@ func (a *Client) DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPo 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) (*ListServiceEdgeRouterPoliciesOK, error) { +func (a *Client) ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceEdgeRouterPoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceEdgeRouterPolicies", Method: "GET", PathPattern: "/service-edge-router-policies", @@ -205,7 +219,12 @@ func (a *Client) ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoli 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 } @@ -224,13 +243,12 @@ func (a *Client) ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoli List the edge routers that a service edge router policy applies to */ -func (a *Client) ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) { +func (a *Client) ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceEdgeRouterPolicyEdgeRoutersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceEdgeRouterPolicyEdgeRouters", Method: "GET", PathPattern: "/service-edge-router-policies/{id}/edge-routers", @@ -242,7 +260,12 @@ func (a *Client) ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeR 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 } @@ -261,13 +284,12 @@ func (a *Client) ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeR List the services that a service edge router policy applies to */ -func (a *Client) ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceEdgeRouterPolicyServicesOK, error) { +func (a *Client) ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServiceEdgeRouterPolicyServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServiceEdgeRouterPolicyServices", Method: "GET", PathPattern: "/service-edge-router-policies/{id}/services", @@ -279,7 +301,12 @@ func (a *Client) ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRout 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 } @@ -298,13 +325,12 @@ func (a *Client) ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRout Update the supplied fields on a service edge policy. Requires admin access. */ -func (a *Client) PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServiceEdgeRouterPolicyOK, error) { +func (a *Client) PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchServiceEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchServiceEdgeRouterPolicy", Method: "PATCH", PathPattern: "/service-edge-router-policies/{id}", @@ -316,7 +342,12 @@ func (a *Client) PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPoli 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 } @@ -335,13 +366,12 @@ func (a *Client) PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPoli Update all fields on a service edge policy by id. Requires admin access. */ -func (a *Client) UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServiceEdgeRouterPolicyOK, error) { +func (a *Client) UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceEdgeRouterPolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateServiceEdgeRouterPolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateServiceEdgeRouterPolicy", Method: "PUT", PathPattern: "/service-edge-router-policies/{id}", @@ -353,7 +383,12 @@ func (a *Client) UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPo 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 } diff --git a/rest_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 similarity index 80% rename from rest_client/service_edge_router_policy/update_service_edge_router_policy_parameters.go rename to rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_parameters.go index 168fbbca2..82f92a1bb 100644 --- a/rest_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 @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateServiceEdgeRouterPolicyParams creates a new UpdateServiceEdgeRouterPolicyParams object -// with the default values initialized. +// 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 { - var () return &UpdateServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateServiceEdgeRouterPolicyParamsWithTimeout creates a new UpdateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *UpdateServiceEdgeRouterPolicyParams { - var () return &UpdateServiceEdgeRouterPolicyParams{ - timeout: timeout, } } // NewUpdateServiceEdgeRouterPolicyParamsWithContext creates a new UpdateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *UpdateServiceEdgeRouterPolicyParams { - var () return &UpdateServiceEdgeRouterPolicyParams{ - Context: ctx, } } // NewUpdateServiceEdgeRouterPolicyParamsWithHTTPClient creates a new UpdateServiceEdgeRouterPolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *UpdateServiceEdgeRouterPolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - A service edge router policy update object + /* Policy. + + A service edge router policy update object */ Policy *rest_model.ServiceEdgeRouterPolicyUpdate @@ -102,6 +102,21 @@ type UpdateServiceEdgeRouterPolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientReq 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 diff --git a/rest_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 similarity index 94% rename from rest_client/service_edge_router_policy/update_service_edge_router_policy_responses.go rename to rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_responses.go index cebb3f7e0..0b9c40211 100644 --- a/rest_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 @@ -71,7 +71,6 @@ func (o *UpdateServiceEdgeRouterPolicyReader) ReadResponse(response runtime.Clie 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()) } @@ -82,7 +81,7 @@ func NewUpdateServiceEdgeRouterPolicyOK() *UpdateServiceEdgeRouterPolicyOK { return &UpdateServiceEdgeRouterPolicyOK{} } -/*UpdateServiceEdgeRouterPolicyOK handles this case with default header values. +/* UpdateServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateServiceEdgeRouterPolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateServiceEdgeRouterPolicyBadRequest() *UpdateServiceEdgeRouterPolicy return &UpdateServiceEdgeRouterPolicyBadRequest{} } -/*UpdateServiceEdgeRouterPolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateServiceEdgeRouterPolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateServiceEdgeRouterPolicyUnauthorized() *UpdateServiceEdgeRouterPoli return &UpdateServiceEdgeRouterPolicyUnauthorized{} } -/*UpdateServiceEdgeRouterPolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateServiceEdgeRouterPolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateServiceEdgeRouterPolicyNotFound() *UpdateServiceEdgeRouterPolicyNo return &UpdateServiceEdgeRouterPolicyNotFound{} } -/*UpdateServiceEdgeRouterPolicyNotFound handles this case with default header values. +/* UpdateServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateServiceEdgeRouterPolicyNotFound struct { 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 } diff --git a/rest_client/service_policy/create_service_policy_parameters.go b/rest_management_api_client/service_policy/create_service_policy_parameters.go similarity index 79% rename from rest_client/service_policy/create_service_policy_parameters.go rename to rest_management_api_client/service_policy/create_service_policy_parameters.go index baa10de5b..9a29cbe58 100644 --- a/rest_client/service_policy/create_service_policy_parameters.go +++ b/rest_management_api_client/service_policy/create_service_policy_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateServicePolicyParams creates a new CreateServicePolicyParams object -// with the default values initialized. +// 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 { - var () return &CreateServicePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewCreateServicePolicyParamsWithTimeout creates a new CreateServicePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateServicePolicyParamsWithTimeout(timeout time.Duration) *CreateServicePolicyParams { - var () return &CreateServicePolicyParams{ - timeout: timeout, } } // NewCreateServicePolicyParamsWithContext creates a new CreateServicePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateServicePolicyParamsWithContext(ctx context.Context) *CreateServicePolicyParams { - var () return &CreateServicePolicyParams{ - Context: ctx, } } // NewCreateServicePolicyParamsWithHTTPClient creates a new CreateServicePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateServicePolicyParamsWithHTTPClient(client *http.Client) *CreateServicePolicyParams { - var () 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 +/* 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. + A service policy to create */ Policy *rest_model.ServicePolicyCreate @@ -97,6 +96,21 @@ type CreateServicePolicyParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Policy != nil { if err := r.SetBodyParam(o.Policy); err != nil { return err diff --git a/rest_client/service_policy/create_service_policy_responses.go b/rest_management_api_client/service_policy/create_service_policy_responses.go similarity index 94% rename from rest_client/service_policy/create_service_policy_responses.go rename to rest_management_api_client/service_policy/create_service_policy_responses.go index fb14c22fa..967210d64 100644 --- a/rest_client/service_policy/create_service_policy_responses.go +++ b/rest_management_api_client/service_policy/create_service_policy_responses.go @@ -65,7 +65,6 @@ func (o *CreateServicePolicyReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewCreateServicePolicyCreated() *CreateServicePolicyCreated { return &CreateServicePolicyCreated{} } -/*CreateServicePolicyCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateServicePolicyCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateServicePolicyBadRequest() *CreateServicePolicyBadRequest { return &CreateServicePolicyBadRequest{} } -/*CreateServicePolicyBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateServicePolicyBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateServicePolicyUnauthorized() *CreateServicePolicyUnauthorized { return &CreateServicePolicyUnauthorized{} } -/*CreateServicePolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateServicePolicyUnauthorized struct { 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 } diff --git a/rest_client/service_policy/delete_service_policy_parameters.go b/rest_management_api_client/service_policy/delete_service_policy_parameters.go similarity index 78% rename from rest_client/service_policy/delete_service_policy_parameters.go rename to rest_management_api_client/service_policy/delete_service_policy_parameters.go index b2967b48b..0f7665235 100644 --- a/rest_client/service_policy/delete_service_policy_parameters.go +++ b/rest_management_api_client/service_policy/delete_service_policy_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteServicePolicyParams creates a new DeleteServicePolicyParams object -// with the default values initialized. +// 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 { - var () return &DeleteServicePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteServicePolicyParamsWithTimeout creates a new DeleteServicePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteServicePolicyParamsWithTimeout(timeout time.Duration) *DeleteServicePolicyParams { - var () return &DeleteServicePolicyParams{ - timeout: timeout, } } // NewDeleteServicePolicyParamsWithContext creates a new DeleteServicePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteServicePolicyParamsWithContext(ctx context.Context) *DeleteServicePolicyParams { - var () return &DeleteServicePolicyParams{ - Context: ctx, } } // NewDeleteServicePolicyParamsWithHTTPClient creates a new DeleteServicePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteServicePolicyParamsWithHTTPClient(client *http.Client) *DeleteServicePolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteServicePolicyParams struct { 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) diff --git a/rest_client/service_policy/delete_service_policy_responses.go b/rest_management_api_client/service_policy/delete_service_policy_responses.go similarity index 94% rename from rest_client/service_policy/delete_service_policy_responses.go rename to rest_management_api_client/service_policy/delete_service_policy_responses.go index 3de5d4037..541d84769 100644 --- a/rest_client/service_policy/delete_service_policy_responses.go +++ b/rest_management_api_client/service_policy/delete_service_policy_responses.go @@ -71,7 +71,6 @@ func (o *DeleteServicePolicyReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -82,7 +81,7 @@ func NewDeleteServicePolicyOK() *DeleteServicePolicyOK { return &DeleteServicePolicyOK{} } -/*DeleteServicePolicyOK handles this case with default header values. +/* DeleteServicePolicyOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteServicePolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteServicePolicyBadRequest() *DeleteServicePolicyBadRequest { return &DeleteServicePolicyBadRequest{} } -/*DeleteServicePolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteServicePolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteServicePolicyUnauthorized() *DeleteServicePolicyUnauthorized { return &DeleteServicePolicyUnauthorized{} } -/*DeleteServicePolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteServicePolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteServicePolicyConflict() *DeleteServicePolicyConflict { return &DeleteServicePolicyConflict{} } -/*DeleteServicePolicyConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteServicePolicyConflict struct { 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 } diff --git a/rest_client/service_policy/detail_service_policy_parameters.go b/rest_management_api_client/service_policy/detail_service_policy_parameters.go similarity index 78% rename from rest_client/service_policy/detail_service_policy_parameters.go rename to rest_management_api_client/service_policy/detail_service_policy_parameters.go index 4f3f180cb..c32a0d881 100644 --- a/rest_client/service_policy/detail_service_policy_parameters.go +++ b/rest_management_api_client/service_policy/detail_service_policy_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailServicePolicyParams creates a new DetailServicePolicyParams object -// with the default values initialized. +// 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 { - var () return &DetailServicePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewDetailServicePolicyParamsWithTimeout creates a new DetailServicePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailServicePolicyParamsWithTimeout(timeout time.Duration) *DetailServicePolicyParams { - var () return &DetailServicePolicyParams{ - timeout: timeout, } } // NewDetailServicePolicyParamsWithContext creates a new DetailServicePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailServicePolicyParamsWithContext(ctx context.Context) *DetailServicePolicyParams { - var () return &DetailServicePolicyParams{ - Context: ctx, } } // NewDetailServicePolicyParamsWithHTTPClient creates a new DetailServicePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailServicePolicyParamsWithHTTPClient(client *http.Client) *DetailServicePolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailServicePolicyParams struct { 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) diff --git a/rest_client/service_policy/detail_service_policy_responses.go b/rest_management_api_client/service_policy/detail_service_policy_responses.go similarity index 94% rename from rest_client/service_policy/detail_service_policy_responses.go rename to rest_management_api_client/service_policy/detail_service_policy_responses.go index d8358d6ed..1937de3b5 100644 --- a/rest_client/service_policy/detail_service_policy_responses.go +++ b/rest_management_api_client/service_policy/detail_service_policy_responses.go @@ -65,7 +65,6 @@ func (o *DetailServicePolicyReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -76,7 +75,7 @@ func NewDetailServicePolicyOK() *DetailServicePolicyOK { return &DetailServicePolicyOK{} } -/*DetailServicePolicyOK handles this case with default header values. +/* DetailServicePolicyOK describes a response with status code 200, with default header values. A single service policy */ @@ -87,7 +86,6 @@ type DetailServicePolicyOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailServicePolicyUnauthorized() *DetailServicePolicyUnauthorized { return &DetailServicePolicyUnauthorized{} } -/*DetailServicePolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailServicePolicyUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailServicePolicyNotFound() *DetailServicePolicyNotFound { return &DetailServicePolicyNotFound{} } -/*DetailServicePolicyNotFound handles this case with default header values. +/* DetailServicePolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailServicePolicyNotFound struct { 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 } diff --git a/rest_client/service_policy/list_service_policies_parameters.go b/rest_management_api_client/service_policy/list_service_policies_parameters.go similarity index 83% rename from rest_client/service_policy/list_service_policies_parameters.go rename to rest_management_api_client/service_policy/list_service_policies_parameters.go index 05add3105..540356758 100644 --- a/rest_client/service_policy/list_service_policies_parameters.go +++ b/rest_management_api_client/service_policy/list_service_policies_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListServicePoliciesParams creates a new ListServicePoliciesParams object -// with the default values initialized. +// 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 { - var () return &ListServicePoliciesParams{ - timeout: cr.DefaultTimeout, } } // NewListServicePoliciesParamsWithTimeout creates a new ListServicePoliciesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicePoliciesParamsWithTimeout(timeout time.Duration) *ListServicePoliciesParams { - var () return &ListServicePoliciesParams{ - timeout: timeout, } } // NewListServicePoliciesParamsWithContext creates a new ListServicePoliciesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicePoliciesParamsWithContext(ctx context.Context) *ListServicePoliciesParams { - var () return &ListServicePoliciesParams{ - Context: ctx, } } // NewListServicePoliciesParamsWithHTTPClient creates a new ListServicePoliciesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicePoliciesParamsWithHTTPClient(client *http.Client) *ListServicePoliciesParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListServicePoliciesParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListServicePoliciesParams) WriteToRequest(r runtime.ClientRequest, reg // 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 { diff --git a/rest_client/service_policy/list_service_policies_responses.go b/rest_management_api_client/service_policy/list_service_policies_responses.go similarity index 95% rename from rest_client/service_policy/list_service_policies_responses.go rename to rest_management_api_client/service_policy/list_service_policies_responses.go index 4cf6db25a..c86a6d7eb 100644 --- a/rest_client/service_policy/list_service_policies_responses.go +++ b/rest_management_api_client/service_policy/list_service_policies_responses.go @@ -59,7 +59,6 @@ func (o *ListServicePoliciesReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -70,7 +69,7 @@ func NewListServicePoliciesOK() *ListServicePoliciesOK { return &ListServicePoliciesOK{} } -/*ListServicePoliciesOK handles this case with default header values. +/* ListServicePoliciesOK describes a response with status code 200, with default header values. A list of service policies */ @@ -81,7 +80,6 @@ type ListServicePoliciesOK struct { 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 } @@ -103,7 +101,7 @@ func NewListServicePoliciesUnauthorized() *ListServicePoliciesUnauthorized { return &ListServicePoliciesUnauthorized{} } -/*ListServicePoliciesUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListServicePoliciesUnauthorized struct { 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 } diff --git a/rest_client/service_policy/list_service_policy_identities_parameters.go b/rest_management_api_client/service_policy/list_service_policy_identities_parameters.go similarity index 83% rename from rest_client/service_policy/list_service_policy_identities_parameters.go rename to rest_management_api_client/service_policy/list_service_policy_identities_parameters.go index 3b734c6cc..5dd201a47 100644 --- a/rest_client/service_policy/list_service_policy_identities_parameters.go +++ b/rest_management_api_client/service_policy/list_service_policy_identities_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServicePolicyIdentitiesParams creates a new ListServicePolicyIdentitiesParams object -// with the default values initialized. +// 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 { - var () return &ListServicePolicyIdentitiesParams{ - timeout: cr.DefaultTimeout, } } // NewListServicePolicyIdentitiesParamsWithTimeout creates a new ListServicePolicyIdentitiesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicePolicyIdentitiesParamsWithTimeout(timeout time.Duration) *ListServicePolicyIdentitiesParams { - var () return &ListServicePolicyIdentitiesParams{ - timeout: timeout, } } // NewListServicePolicyIdentitiesParamsWithContext creates a new ListServicePolicyIdentitiesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicePolicyIdentitiesParamsWithContext(ctx context.Context) *ListServicePolicyIdentitiesParams { - var () return &ListServicePolicyIdentitiesParams{ - Context: ctx, } } // NewListServicePolicyIdentitiesParamsWithHTTPClient creates a new ListServicePolicyIdentitiesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicePolicyIdentitiesParamsWithHTTPClient(client *http.Client) *ListServicePolicyIdentitiesParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServicePolicyIdentitiesParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServicePolicyIdentitiesParams) WriteToRequest(r runtime.ClientReque // 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 @@ -212,32 +230,34 @@ func (o *ListServicePolicyIdentitiesParams) WriteToRequest(r runtime.ClientReque // 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 { diff --git a/rest_client/service_policy/list_service_policy_identities_responses.go b/rest_management_api_client/service_policy/list_service_policy_identities_responses.go similarity index 94% rename from rest_client/service_policy/list_service_policy_identities_responses.go rename to rest_management_api_client/service_policy/list_service_policy_identities_responses.go index e6f7614c3..da8044e38 100644 --- a/rest_client/service_policy/list_service_policy_identities_responses.go +++ b/rest_management_api_client/service_policy/list_service_policy_identities_responses.go @@ -65,7 +65,6 @@ func (o *ListServicePolicyIdentitiesReader) ReadResponse(response runtime.Client 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()) } @@ -76,7 +75,7 @@ func NewListServicePolicyIdentitiesOK() *ListServicePolicyIdentitiesOK { return &ListServicePolicyIdentitiesOK{} } -/*ListServicePolicyIdentitiesOK handles this case with default header values. +/* ListServicePolicyIdentitiesOK describes a response with status code 200, with default header values. A list of identities */ @@ -87,7 +86,6 @@ type ListServicePolicyIdentitiesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListServicePolicyIdentitiesBadRequest() *ListServicePolicyIdentitiesBadR return &ListServicePolicyIdentitiesBadRequest{} } -/*ListServicePolicyIdentitiesBadRequest handles this case with default header values. +/* ListServicePolicyIdentitiesBadRequest describes a response with status code 400, with default header values. The requested resource does not exist */ @@ -120,7 +118,6 @@ type ListServicePolicyIdentitiesBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewListServicePolicyIdentitiesUnauthorized() *ListServicePolicyIdentitiesUn return &ListServicePolicyIdentitiesUnauthorized{} } -/*ListServicePolicyIdentitiesUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type ListServicePolicyIdentitiesUnauthorized struct { 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 } diff --git a/rest_client/service_policy/list_service_policy_posture_checks_parameters.go b/rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go similarity index 83% rename from rest_client/service_policy/list_service_policy_posture_checks_parameters.go rename to rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go index 4de6bf730..1a3ba6d0c 100644 --- a/rest_client/service_policy/list_service_policy_posture_checks_parameters.go +++ b/rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServicePolicyPostureChecksParams creates a new ListServicePolicyPostureChecksParams object -// with the default values initialized. +// 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 { - var () return &ListServicePolicyPostureChecksParams{ - timeout: cr.DefaultTimeout, } } // NewListServicePolicyPostureChecksParamsWithTimeout creates a new ListServicePolicyPostureChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicePolicyPostureChecksParamsWithTimeout(timeout time.Duration) *ListServicePolicyPostureChecksParams { - var () return &ListServicePolicyPostureChecksParams{ - timeout: timeout, } } // NewListServicePolicyPostureChecksParamsWithContext creates a new ListServicePolicyPostureChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicePolicyPostureChecksParamsWithContext(ctx context.Context) *ListServicePolicyPostureChecksParams { - var () return &ListServicePolicyPostureChecksParams{ - Context: ctx, } } // NewListServicePolicyPostureChecksParamsWithHTTPClient creates a new ListServicePolicyPostureChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicePolicyPostureChecksParamsWithHTTPClient(client *http.Client) *ListServicePolicyPostureChecksParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServicePolicyPostureChecksParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServicePolicyPostureChecksParams) WriteToRequest(r runtime.ClientRe // 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 @@ -212,32 +230,34 @@ func (o *ListServicePolicyPostureChecksParams) WriteToRequest(r runtime.ClientRe // 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 { diff --git a/rest_client/service_policy/list_service_policy_posture_checks_responses.go b/rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go similarity index 94% rename from rest_client/service_policy/list_service_policy_posture_checks_responses.go rename to rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go index 99ae6d391..fcad9554e 100644 --- a/rest_client/service_policy/list_service_policy_posture_checks_responses.go +++ b/rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go @@ -65,7 +65,6 @@ func (o *ListServicePolicyPostureChecksReader) ReadResponse(response runtime.Cli 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()) } @@ -76,7 +75,7 @@ func NewListServicePolicyPostureChecksOK() *ListServicePolicyPostureChecksOK { return &ListServicePolicyPostureChecksOK{} } -/*ListServicePolicyPostureChecksOK handles this case with default header values. +/* ListServicePolicyPostureChecksOK describes a response with status code 200, with default header values. A list of posture checks */ @@ -87,7 +86,6 @@ type ListServicePolicyPostureChecksOK struct { 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 } @@ -109,7 +107,7 @@ func NewListServicePolicyPostureChecksBadRequest() *ListServicePolicyPostureChec return &ListServicePolicyPostureChecksBadRequest{} } -/*ListServicePolicyPostureChecksBadRequest handles this case with default header values. +/* ListServicePolicyPostureChecksBadRequest describes a response with status code 400, with default header values. The requested resource does not exist */ @@ -120,7 +118,6 @@ type ListServicePolicyPostureChecksBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewListServicePolicyPostureChecksUnauthorized() *ListServicePolicyPostureCh return &ListServicePolicyPostureChecksUnauthorized{} } -/*ListServicePolicyPostureChecksUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type ListServicePolicyPostureChecksUnauthorized struct { 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 } diff --git a/rest_client/service_policy/list_service_policy_services_parameters.go b/rest_management_api_client/service_policy/list_service_policy_services_parameters.go similarity index 83% rename from rest_client/service_policy/list_service_policy_services_parameters.go rename to rest_management_api_client/service_policy/list_service_policy_services_parameters.go index d71ae5b90..7ddd3b8d0 100644 --- a/rest_client/service_policy/list_service_policy_services_parameters.go +++ b/rest_management_api_client/service_policy/list_service_policy_services_parameters.go @@ -41,60 +41,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListServicePolicyServicesParams creates a new ListServicePolicyServicesParams object -// with the default values initialized. +// 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 { - var () return &ListServicePolicyServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListServicePolicyServicesParamsWithTimeout creates a new ListServicePolicyServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicePolicyServicesParamsWithTimeout(timeout time.Duration) *ListServicePolicyServicesParams { - var () return &ListServicePolicyServicesParams{ - timeout: timeout, } } // NewListServicePolicyServicesParamsWithContext creates a new ListServicePolicyServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicePolicyServicesParamsWithContext(ctx context.Context) *ListServicePolicyServicesParams { - var () return &ListServicePolicyServicesParams{ - Context: ctx, } } // NewListServicePolicyServicesParamsWithHTTPClient creates a new ListServicePolicyServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicePolicyServicesParamsWithHTTPClient(client *http.Client) *ListServicePolicyServicesParams { - var () 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 +/* 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. Filter *string - /*ID - The id of the requested resource + /* ID. + + The id of the requested resource */ ID string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -102,6 +104,21 @@ type ListServicePolicyServicesParams struct { 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) @@ -191,16 +208,17 @@ func (o *ListServicePolicyServicesParams) WriteToRequest(r runtime.ClientRequest // 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 @@ -212,32 +230,34 @@ func (o *ListServicePolicyServicesParams) WriteToRequest(r runtime.ClientRequest // 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 { diff --git a/rest_client/service_policy/list_service_policy_services_responses.go b/rest_management_api_client/service_policy/list_service_policy_services_responses.go similarity index 94% rename from rest_client/service_policy/list_service_policy_services_responses.go rename to rest_management_api_client/service_policy/list_service_policy_services_responses.go index 1e4083076..e405d5a22 100644 --- a/rest_client/service_policy/list_service_policy_services_responses.go +++ b/rest_management_api_client/service_policy/list_service_policy_services_responses.go @@ -65,7 +65,6 @@ func (o *ListServicePolicyServicesReader) ReadResponse(response runtime.ClientRe 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()) } @@ -76,7 +75,7 @@ func NewListServicePolicyServicesOK() *ListServicePolicyServicesOK { return &ListServicePolicyServicesOK{} } -/*ListServicePolicyServicesOK handles this case with default header values. +/* ListServicePolicyServicesOK describes a response with status code 200, with default header values. A list of services */ @@ -87,7 +86,6 @@ type ListServicePolicyServicesOK struct { 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 } @@ -109,7 +107,7 @@ func NewListServicePolicyServicesBadRequest() *ListServicePolicyServicesBadReque return &ListServicePolicyServicesBadRequest{} } -/*ListServicePolicyServicesBadRequest handles this case with default header values. +/* ListServicePolicyServicesBadRequest describes a response with status code 400, with default header values. The requested resource does not exist */ @@ -120,7 +118,6 @@ type ListServicePolicyServicesBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewListServicePolicyServicesUnauthorized() *ListServicePolicyServicesUnauth return &ListServicePolicyServicesUnauthorized{} } -/*ListServicePolicyServicesUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type ListServicePolicyServicesUnauthorized struct { 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 } diff --git a/rest_client/service_policy/patch_service_policy_parameters.go b/rest_management_api_client/service_policy/patch_service_policy_parameters.go similarity index 80% rename from rest_client/service_policy/patch_service_policy_parameters.go rename to rest_management_api_client/service_policy/patch_service_policy_parameters.go index 4af965518..22ec286e3 100644 --- a/rest_client/service_policy/patch_service_policy_parameters.go +++ b/rest_management_api_client/service_policy/patch_service_policy_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchServicePolicyParams creates a new PatchServicePolicyParams object -// with the default values initialized. +// 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 { - var () return &PatchServicePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewPatchServicePolicyParamsWithTimeout creates a new PatchServicePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchServicePolicyParamsWithTimeout(timeout time.Duration) *PatchServicePolicyParams { - var () return &PatchServicePolicyParams{ - timeout: timeout, } } // NewPatchServicePolicyParamsWithContext creates a new PatchServicePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchServicePolicyParamsWithContext(ctx context.Context) *PatchServicePolicyParams { - var () return &PatchServicePolicyParams{ - Context: ctx, } } // NewPatchServicePolicyParamsWithHTTPClient creates a new PatchServicePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchServicePolicyParamsWithHTTPClient(client *http.Client) *PatchServicePolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - A service policy patch object + /* Policy. + + A service policy patch object */ Policy *rest_model.ServicePolicyPatch @@ -102,6 +102,21 @@ type PatchServicePolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg s 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 diff --git a/rest_client/service_policy/patch_service_policy_responses.go b/rest_management_api_client/service_policy/patch_service_policy_responses.go similarity index 94% rename from rest_client/service_policy/patch_service_policy_responses.go rename to rest_management_api_client/service_policy/patch_service_policy_responses.go index 80ce6ba8f..675adaa17 100644 --- a/rest_client/service_policy/patch_service_policy_responses.go +++ b/rest_management_api_client/service_policy/patch_service_policy_responses.go @@ -71,7 +71,6 @@ func (o *PatchServicePolicyReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -82,7 +81,7 @@ func NewPatchServicePolicyOK() *PatchServicePolicyOK { return &PatchServicePolicyOK{} } -/*PatchServicePolicyOK handles this case with default header values. +/* PatchServicePolicyOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchServicePolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchServicePolicyBadRequest() *PatchServicePolicyBadRequest { return &PatchServicePolicyBadRequest{} } -/*PatchServicePolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchServicePolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchServicePolicyUnauthorized() *PatchServicePolicyUnauthorized { return &PatchServicePolicyUnauthorized{} } -/*PatchServicePolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchServicePolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchServicePolicyNotFound() *PatchServicePolicyNotFound { return &PatchServicePolicyNotFound{} } -/*PatchServicePolicyNotFound handles this case with default header values. +/* PatchServicePolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchServicePolicyNotFound struct { 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 } diff --git a/rest_client/service_policy/service_policy_client.go b/rest_management_api_client/service_policy/service_policy_client.go similarity index 82% rename from rest_client/service_policy/service_policy_client.go rename to rest_management_api_client/service_policy/service_policy_client.go index c4696946d..1d5c720ef 100644 --- a/rest_client/service_policy/service_policy_client.go +++ b/rest_management_api_client/service_policy/service_policy_client.go @@ -49,25 +49,28 @@ type Client struct { 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) (*CreateServicePolicyCreated, error) + CreateServicePolicy(params *CreateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServicePolicyCreated, error) - DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServicePolicyOK, error) + DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServicePolicyOK, error) - DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServicePolicyOK, error) + DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServicePolicyOK, error) - ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicePoliciesOK, error) + ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePoliciesOK, error) - ListServicePolicyIdentities(params *ListServicePolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicePolicyIdentitiesOK, error) + ListServicePolicyIdentities(params *ListServicePolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyIdentitiesOK, error) - ListServicePolicyPostureChecks(params *ListServicePolicyPostureChecksParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicePolicyPostureChecksOK, error) + ListServicePolicyPostureChecks(params *ListServicePolicyPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyPostureChecksOK, error) - ListServicePolicyServices(params *ListServicePolicyServicesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicePolicyServicesOK, error) + ListServicePolicyServices(params *ListServicePolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyServicesOK, error) - PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServicePolicyOK, error) + PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServicePolicyOK, error) - UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServicePolicyOK, error) + UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServicePolicyOK, error) SetTransport(transport runtime.ClientTransport) } @@ -77,13 +80,12 @@ type ClientService interface { Create a service policy resource. Requires admin access. */ -func (a *Client) CreateServicePolicy(params *CreateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateServicePolicyCreated, error) { +func (a *Client) CreateServicePolicy(params *CreateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServicePolicyCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateServicePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createServicePolicy", Method: "POST", PathPattern: "/service-policies", @@ -95,7 +97,12 @@ func (a *Client) CreateServicePolicy(params *CreateServicePolicyParams, authInfo 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 } @@ -114,13 +121,12 @@ func (a *Client) CreateServicePolicy(params *CreateServicePolicyParams, authInfo Delete a service policy by id. Requires admin access. */ -func (a *Client) DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteServicePolicyOK, error) { +func (a *Client) DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServicePolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteServicePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteServicePolicy", Method: "DELETE", PathPattern: "/service-policies/{id}", @@ -132,7 +138,12 @@ func (a *Client) DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo 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 } @@ -151,13 +162,12 @@ func (a *Client) DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo Retrieves a single service policy by id. Requires admin access. */ -func (a *Client) DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*DetailServicePolicyOK, error) { +func (a *Client) DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServicePolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailServicePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailServicePolicy", Method: "GET", PathPattern: "/service-policies/{id}", @@ -169,7 +179,12 @@ func (a *Client) DetailServicePolicy(params *DetailServicePolicyParams, authInfo 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 } @@ -189,13 +204,12 @@ func (a *Client) DetailServicePolicy(params *DetailServicePolicyParams, authInfo Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServicePoliciesOK, error) { +func (a *Client) ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePoliciesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicePoliciesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServicePolicies", Method: "GET", PathPattern: "/service-policies", @@ -207,7 +221,12 @@ func (a *Client) ListServicePolicies(params *ListServicePoliciesParams, authInfo 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 } @@ -227,13 +246,12 @@ func (a *Client) ListServicePolicies(params *ListServicePoliciesParams, authInfo 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) (*ListServicePolicyIdentitiesOK, error) { +func (a *Client) ListServicePolicyIdentities(params *ListServicePolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicePolicyIdentitiesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServicePolicyIdentities", Method: "GET", PathPattern: "/service-policies/{id}/identities", @@ -245,7 +263,12 @@ func (a *Client) ListServicePolicyIdentities(params *ListServicePolicyIdentities 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 } @@ -265,13 +288,12 @@ func (a *Client) ListServicePolicyIdentities(params *ListServicePolicyIdentities 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) (*ListServicePolicyPostureChecksOK, error) { +func (a *Client) ListServicePolicyPostureChecks(params *ListServicePolicyPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyPostureChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicePolicyPostureChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServicePolicyPostureChecks", Method: "GET", PathPattern: "/service-policies/{id}/posture-checks", @@ -283,7 +305,12 @@ func (a *Client) ListServicePolicyPostureChecks(params *ListServicePolicyPosture 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 } @@ -303,13 +330,12 @@ func (a *Client) ListServicePolicyPostureChecks(params *ListServicePolicyPosture 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) (*ListServicePolicyServicesOK, error) { +func (a *Client) ListServicePolicyServices(params *ListServicePolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicePolicyServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listServicePolicyServices", Method: "GET", PathPattern: "/service-policies/{id}/services", @@ -321,7 +347,12 @@ func (a *Client) ListServicePolicyServices(params *ListServicePolicyServicesPara 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 } @@ -340,13 +371,12 @@ func (a *Client) ListServicePolicyServices(params *ListServicePolicyServicesPara Update the supplied fields on a service policy. Requires admin access. */ -func (a *Client) PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*PatchServicePolicyOK, error) { +func (a *Client) PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServicePolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchServicePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchServicePolicy", Method: "PATCH", PathPattern: "/service-policies/{id}", @@ -358,7 +388,12 @@ func (a *Client) PatchServicePolicy(params *PatchServicePolicyParams, authInfo r 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 } @@ -377,13 +412,12 @@ func (a *Client) PatchServicePolicy(params *PatchServicePolicyParams, authInfo r Update all fields on a service policy by id. Requires admin access. */ -func (a *Client) UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateServicePolicyOK, error) { +func (a *Client) UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServicePolicyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateServicePolicyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateServicePolicy", Method: "PUT", PathPattern: "/service-policies/{id}", @@ -395,7 +429,12 @@ func (a *Client) UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo 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 } diff --git a/rest_client/service_policy/update_service_policy_parameters.go b/rest_management_api_client/service_policy/update_service_policy_parameters.go similarity index 80% rename from rest_client/service_policy/update_service_policy_parameters.go rename to rest_management_api_client/service_policy/update_service_policy_parameters.go index 0c0162e98..2ddebfc4e 100644 --- a/rest_client/service_policy/update_service_policy_parameters.go +++ b/rest_management_api_client/service_policy/update_service_policy_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateServicePolicyParams creates a new UpdateServicePolicyParams object -// with the default values initialized. +// 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 { - var () return &UpdateServicePolicyParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateServicePolicyParamsWithTimeout creates a new UpdateServicePolicyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateServicePolicyParamsWithTimeout(timeout time.Duration) *UpdateServicePolicyParams { - var () return &UpdateServicePolicyParams{ - timeout: timeout, } } // NewUpdateServicePolicyParamsWithContext creates a new UpdateServicePolicyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateServicePolicyParamsWithContext(ctx context.Context) *UpdateServicePolicyParams { - var () return &UpdateServicePolicyParams{ - Context: ctx, } } // NewUpdateServicePolicyParamsWithHTTPClient creates a new UpdateServicePolicyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateServicePolicyParamsWithHTTPClient(client *http.Client) *UpdateServicePolicyParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Policy - A service policy update object + /* Policy. + + A service policy update object */ Policy *rest_model.ServicePolicyUpdate @@ -102,6 +102,21 @@ type UpdateServicePolicyParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg 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 diff --git a/rest_client/service_policy/update_service_policy_responses.go b/rest_management_api_client/service_policy/update_service_policy_responses.go similarity index 94% rename from rest_client/service_policy/update_service_policy_responses.go rename to rest_management_api_client/service_policy/update_service_policy_responses.go index 41dea2926..2d7d8a0d7 100644 --- a/rest_client/service_policy/update_service_policy_responses.go +++ b/rest_management_api_client/service_policy/update_service_policy_responses.go @@ -71,7 +71,6 @@ func (o *UpdateServicePolicyReader) ReadResponse(response runtime.ClientResponse 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()) } @@ -82,7 +81,7 @@ func NewUpdateServicePolicyOK() *UpdateServicePolicyOK { return &UpdateServicePolicyOK{} } -/*UpdateServicePolicyOK handles this case with default header values. +/* UpdateServicePolicyOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateServicePolicyOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateServicePolicyBadRequest() *UpdateServicePolicyBadRequest { return &UpdateServicePolicyBadRequest{} } -/*UpdateServicePolicyBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateServicePolicyBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateServicePolicyUnauthorized() *UpdateServicePolicyUnauthorized { return &UpdateServicePolicyUnauthorized{} } -/*UpdateServicePolicyUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateServicePolicyUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateServicePolicyNotFound() *UpdateServicePolicyNotFound { return &UpdateServicePolicyNotFound{} } -/*UpdateServicePolicyNotFound handles this case with default header values. +/* UpdateServicePolicyNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateServicePolicyNotFound struct { 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 } diff --git a/rest_management_api_client/session/delete_session_parameters.go b/rest_management_api_client/session/delete_session_parameters.go new file mode 100644 index 000000000..911fb733a --- /dev/null +++ b/rest_management_api_client/session/delete_session_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9c499e3a0 --- /dev/null +++ b/rest_management_api_client/session/delete_session_responses.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d213be760 --- /dev/null +++ b/rest_management_api_client/session/detail_session_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..374ade674 --- /dev/null +++ b/rest_management_api_client/session/detail_session_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/session/detail_session_route_path_parameters.go b/rest_management_api_client/session/detail_session_route_path_parameters.go similarity index 78% rename from rest_client/session/detail_session_route_path_parameters.go rename to rest_management_api_client/session/detail_session_route_path_parameters.go index f73088b9c..567e92d22 100644 --- a/rest_client/session/detail_session_route_path_parameters.go +++ b/rest_management_api_client/session/detail_session_route_path_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailSessionRoutePathParams creates a new DetailSessionRoutePathParams object -// with the default values initialized. +// 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 { - var () return &DetailSessionRoutePathParams{ - timeout: cr.DefaultTimeout, } } // NewDetailSessionRoutePathParamsWithTimeout creates a new DetailSessionRoutePathParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailSessionRoutePathParamsWithTimeout(timeout time.Duration) *DetailSessionRoutePathParams { - var () return &DetailSessionRoutePathParams{ - timeout: timeout, } } // NewDetailSessionRoutePathParamsWithContext creates a new DetailSessionRoutePathParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailSessionRoutePathParamsWithContext(ctx context.Context) *DetailSessionRoutePathParams { - var () return &DetailSessionRoutePathParams{ - Context: ctx, } } // NewDetailSessionRoutePathParamsWithHTTPClient creates a new DetailSessionRoutePathParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailSessionRoutePathParamsWithHTTPClient(client *http.Client) *DetailSessionRoutePathParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailSessionRoutePathParams struct { 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) diff --git a/rest_client/session/detail_session_route_path_responses.go b/rest_management_api_client/session/detail_session_route_path_responses.go similarity index 94% rename from rest_client/session/detail_session_route_path_responses.go rename to rest_management_api_client/session/detail_session_route_path_responses.go index 1cc63a63b..98fcf0daf 100644 --- a/rest_client/session/detail_session_route_path_responses.go +++ b/rest_management_api_client/session/detail_session_route_path_responses.go @@ -65,7 +65,6 @@ func (o *DetailSessionRoutePathReader) ReadResponse(response runtime.ClientRespo 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()) } @@ -76,7 +75,7 @@ func NewDetailSessionRoutePathOK() *DetailSessionRoutePathOK { return &DetailSessionRoutePathOK{} } -/*DetailSessionRoutePathOK handles this case with default header values. +/* DetailSessionRoutePathOK describes a response with status code 200, with default header values. A single session's route path */ @@ -87,7 +86,6 @@ type DetailSessionRoutePathOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailSessionRoutePathUnauthorized() *DetailSessionRoutePathUnauthorized return &DetailSessionRoutePathUnauthorized{} } -/*DetailSessionRoutePathUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailSessionRoutePathUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailSessionRoutePathNotFound() *DetailSessionRoutePathNotFound { return &DetailSessionRoutePathNotFound{} } -/*DetailSessionRoutePathNotFound handles this case with default header values. +/* DetailSessionRoutePathNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailSessionRoutePathNotFound struct { 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 } diff --git a/rest_management_api_client/session/list_sessions_parameters.go b/rest_management_api_client/session/list_sessions_parameters.go new file mode 100644 index 000000000..377255fe2 --- /dev/null +++ b/rest_management_api_client/session/list_sessions_parameters.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..a6ca7c0b3 --- /dev/null +++ b/rest_management_api_client/session/list_sessions_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 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 +} + +// 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/session/session_client.go b/rest_management_api_client/session/session_client.go similarity index 76% rename from rest_client/session/session_client.go rename to rest_management_api_client/session/session_client.go index 5d05a60df..14c4d2b35 100644 --- a/rest_client/session/session_client.go +++ b/rest_management_api_client/session/session_client.go @@ -49,70 +49,33 @@ type Client struct { 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) (*CreateSessionCreated, error) + DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) - DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSessionOK, error) + DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) - DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DetailSessionOK, error) + DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionRoutePathOK, error) - DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter) (*DetailSessionRoutePathOK, error) - - ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListSessionsOK, error) + ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) SetTransport(transport runtime.ClientTransport) } -/* - CreateSession creates a session resource - - Create a session resource. Requires admin access. -*/ -func (a *Client) CreateSession(params *CreateSessionParams, authInfo runtime.ClientAuthInfoWriter) (*CreateSessionCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateSessionParams() - } - - result, err := a.transport.Submit(&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, - }) - 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. Requires admin access. */ -func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSessionOK, error) { +func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteSessionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteSession", Method: "DELETE", PathPattern: "/sessions/{id}", @@ -124,7 +87,12 @@ func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.Cli 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 } @@ -143,13 +111,12 @@ func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.Cli Retrieves a single session by id. Requires admin access. */ -func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DetailSessionOK, error) { +func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailSessionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailSession", Method: "GET", PathPattern: "/sessions/{id}", @@ -161,7 +128,12 @@ func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.Cli 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 } @@ -180,13 +152,12 @@ func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.Cli Retrieves a single session's route path by id. Requires admin access. */ -func (a *Client) DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter) (*DetailSessionRoutePathOK, error) { +func (a *Client) DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionRoutePathOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailSessionRoutePathParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailSessionRoutePath", Method: "GET", PathPattern: "/sessions/{id}/route-path", @@ -198,7 +169,12 @@ func (a *Client) DetailSessionRoutePath(params *DetailSessionRoutePathParams, au 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 } @@ -221,13 +197,12 @@ Sessions are tied to an API session and are moved when an API session times out (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) (*ListSessionsOK, error) { +func (a *Client) ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listSessions", Method: "GET", PathPattern: "/sessions", @@ -239,7 +214,12 @@ func (a *Client) ListSessions(params *ListSessionsParams, authInfo runtime.Clien 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 } diff --git a/rest_client/terminator/create_terminator_parameters.go b/rest_management_api_client/terminator/create_terminator_parameters.go similarity index 79% rename from rest_client/terminator/create_terminator_parameters.go rename to rest_management_api_client/terminator/create_terminator_parameters.go index 48f275643..c2e7d56ef 100644 --- a/rest_client/terminator/create_terminator_parameters.go +++ b/rest_management_api_client/terminator/create_terminator_parameters.go @@ -42,53 +42,52 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewCreateTerminatorParams creates a new CreateTerminatorParams object -// with the default values initialized. +// 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 { - var () return &CreateTerminatorParams{ - timeout: cr.DefaultTimeout, } } // NewCreateTerminatorParamsWithTimeout creates a new CreateTerminatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateTerminatorParamsWithTimeout(timeout time.Duration) *CreateTerminatorParams { - var () return &CreateTerminatorParams{ - timeout: timeout, } } // NewCreateTerminatorParamsWithContext creates a new CreateTerminatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateTerminatorParamsWithContext(ctx context.Context) *CreateTerminatorParams { - var () return &CreateTerminatorParams{ - Context: ctx, } } // NewCreateTerminatorParamsWithHTTPClient creates a new CreateTerminatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateTerminatorParamsWithHTTPClient(client *http.Client) *CreateTerminatorParams { - var () 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 +/* 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. + A terminator to create */ Terminator *rest_model.TerminatorCreate @@ -97,6 +96,21 @@ type CreateTerminatorParams struct { 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) @@ -148,7 +162,6 @@ func (o *CreateTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.Terminator != nil { if err := r.SetBodyParam(o.Terminator); err != nil { return err diff --git a/rest_client/terminator/create_terminator_responses.go b/rest_management_api_client/terminator/create_terminator_responses.go similarity index 94% rename from rest_client/terminator/create_terminator_responses.go rename to rest_management_api_client/terminator/create_terminator_responses.go index 4e03c9852..b664ea867 100644 --- a/rest_client/terminator/create_terminator_responses.go +++ b/rest_management_api_client/terminator/create_terminator_responses.go @@ -65,7 +65,6 @@ func (o *CreateTerminatorReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewCreateTerminatorCreated() *CreateTerminatorCreated { return &CreateTerminatorCreated{} } -/*CreateTerminatorCreated handles this case with default header values. +/* 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 */ @@ -87,7 +86,6 @@ type CreateTerminatorCreated struct { 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 } @@ -109,7 +107,7 @@ func NewCreateTerminatorBadRequest() *CreateTerminatorBadRequest { return &CreateTerminatorBadRequest{} } -/*CreateTerminatorBadRequest handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type CreateTerminatorBadRequest struct { 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 } @@ -142,7 +139,7 @@ func NewCreateTerminatorUnauthorized() *CreateTerminatorUnauthorized { return &CreateTerminatorUnauthorized{} } -/*CreateTerminatorUnauthorized handles this case with default header values. +/* 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 */ @@ -153,7 +150,6 @@ type CreateTerminatorUnauthorized struct { 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 } diff --git a/rest_client/terminator/delete_terminator_parameters.go b/rest_management_api_client/terminator/delete_terminator_parameters.go similarity index 78% rename from rest_client/terminator/delete_terminator_parameters.go rename to rest_management_api_client/terminator/delete_terminator_parameters.go index 843ced466..a15376627 100644 --- a/rest_client/terminator/delete_terminator_parameters.go +++ b/rest_management_api_client/terminator/delete_terminator_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteTerminatorParams creates a new DeleteTerminatorParams object -// with the default values initialized. +// 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 { - var () return &DeleteTerminatorParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteTerminatorParamsWithTimeout creates a new DeleteTerminatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteTerminatorParamsWithTimeout(timeout time.Duration) *DeleteTerminatorParams { - var () return &DeleteTerminatorParams{ - timeout: timeout, } } // NewDeleteTerminatorParamsWithContext creates a new DeleteTerminatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteTerminatorParamsWithContext(ctx context.Context) *DeleteTerminatorParams { - var () return &DeleteTerminatorParams{ - Context: ctx, } } // NewDeleteTerminatorParamsWithHTTPClient creates a new DeleteTerminatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteTerminatorParamsWithHTTPClient(client *http.Client) *DeleteTerminatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DeleteTerminatorParams struct { 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) diff --git a/rest_client/terminator/delete_terminator_responses.go b/rest_management_api_client/terminator/delete_terminator_responses.go similarity index 94% rename from rest_client/terminator/delete_terminator_responses.go rename to rest_management_api_client/terminator/delete_terminator_responses.go index 5ed1b5d0a..af2d2087a 100644 --- a/rest_client/terminator/delete_terminator_responses.go +++ b/rest_management_api_client/terminator/delete_terminator_responses.go @@ -71,7 +71,6 @@ func (o *DeleteTerminatorReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewDeleteTerminatorOK() *DeleteTerminatorOK { return &DeleteTerminatorOK{} } -/*DeleteTerminatorOK handles this case with default header values. +/* DeleteTerminatorOK describes a response with status code 200, with default header values. The delete request was successful and the resource has been removed */ @@ -93,7 +92,6 @@ type DeleteTerminatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewDeleteTerminatorBadRequest() *DeleteTerminatorBadRequest { return &DeleteTerminatorBadRequest{} } -/*DeleteTerminatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type DeleteTerminatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewDeleteTerminatorUnauthorized() *DeleteTerminatorUnauthorized { return &DeleteTerminatorUnauthorized{} } -/*DeleteTerminatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type DeleteTerminatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewDeleteTerminatorConflict() *DeleteTerminatorConflict { return &DeleteTerminatorConflict{} } -/*DeleteTerminatorConflict handles this case with default header values. +/* 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. */ @@ -192,7 +188,6 @@ type DeleteTerminatorConflict struct { 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 } diff --git a/rest_client/terminator/detail_terminator_parameters.go b/rest_management_api_client/terminator/detail_terminator_parameters.go similarity index 78% rename from rest_client/terminator/detail_terminator_parameters.go rename to rest_management_api_client/terminator/detail_terminator_parameters.go index b4841da82..87b72e0a9 100644 --- a/rest_client/terminator/detail_terminator_parameters.go +++ b/rest_management_api_client/terminator/detail_terminator_parameters.go @@ -40,53 +40,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDetailTerminatorParams creates a new DetailTerminatorParams object -// with the default values initialized. +// 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 { - var () return &DetailTerminatorParams{ - timeout: cr.DefaultTimeout, } } // NewDetailTerminatorParamsWithTimeout creates a new DetailTerminatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDetailTerminatorParamsWithTimeout(timeout time.Duration) *DetailTerminatorParams { - var () return &DetailTerminatorParams{ - timeout: timeout, } } // NewDetailTerminatorParamsWithContext creates a new DetailTerminatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDetailTerminatorParamsWithContext(ctx context.Context) *DetailTerminatorParams { - var () return &DetailTerminatorParams{ - Context: ctx, } } // NewDetailTerminatorParamsWithHTTPClient creates a new DetailTerminatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDetailTerminatorParamsWithHTTPClient(client *http.Client) *DetailTerminatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string @@ -95,6 +94,21 @@ type DetailTerminatorParams struct { 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) diff --git a/rest_client/terminator/detail_terminator_responses.go b/rest_management_api_client/terminator/detail_terminator_responses.go similarity index 94% rename from rest_client/terminator/detail_terminator_responses.go rename to rest_management_api_client/terminator/detail_terminator_responses.go index 4de438ec2..7e0c108cd 100644 --- a/rest_client/terminator/detail_terminator_responses.go +++ b/rest_management_api_client/terminator/detail_terminator_responses.go @@ -65,7 +65,6 @@ func (o *DetailTerminatorReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -76,7 +75,7 @@ func NewDetailTerminatorOK() *DetailTerminatorOK { return &DetailTerminatorOK{} } -/*DetailTerminatorOK handles this case with default header values. +/* DetailTerminatorOK describes a response with status code 200, with default header values. A single terminator */ @@ -87,7 +86,6 @@ type DetailTerminatorOK struct { 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 } @@ -109,7 +107,7 @@ func NewDetailTerminatorUnauthorized() *DetailTerminatorUnauthorized { return &DetailTerminatorUnauthorized{} } -/*DetailTerminatorUnauthorized handles this case with default header values. +/* 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 */ @@ -120,7 +118,6 @@ type DetailTerminatorUnauthorized struct { 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 } @@ -142,7 +139,7 @@ func NewDetailTerminatorNotFound() *DetailTerminatorNotFound { return &DetailTerminatorNotFound{} } -/*DetailTerminatorNotFound handles this case with default header values. +/* DetailTerminatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -153,7 +150,6 @@ type DetailTerminatorNotFound struct { 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 } diff --git a/rest_client/terminator/list_terminators_parameters.go b/rest_management_api_client/terminator/list_terminators_parameters.go similarity index 83% rename from rest_client/terminator/list_terminators_parameters.go rename to rest_management_api_client/terminator/list_terminators_parameters.go index 8257196ff..8254fcfff 100644 --- a/rest_client/terminator/list_terminators_parameters.go +++ b/rest_management_api_client/terminator/list_terminators_parameters.go @@ -41,55 +41,56 @@ import ( "github.com/go-openapi/swag" ) -// NewListTerminatorsParams creates a new ListTerminatorsParams object -// with the default values initialized. +// 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 { - var () return &ListTerminatorsParams{ - timeout: cr.DefaultTimeout, } } // NewListTerminatorsParamsWithTimeout creates a new ListTerminatorsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListTerminatorsParamsWithTimeout(timeout time.Duration) *ListTerminatorsParams { - var () return &ListTerminatorsParams{ - timeout: timeout, } } // NewListTerminatorsParamsWithContext creates a new ListTerminatorsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListTerminatorsParamsWithContext(ctx context.Context) *ListTerminatorsParams { - var () return &ListTerminatorsParams{ - Context: ctx, } } // NewListTerminatorsParamsWithHTTPClient creates a new ListTerminatorsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListTerminatorsParamsWithHTTPClient(client *http.Client) *ListTerminatorsParams { - var () 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 +/* 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. Filter *string - /*Limit*/ + + // Limit. Limit *int64 - /*Offset*/ + + // Offset. Offset *int64 timeout time.Duration @@ -97,6 +98,21 @@ type ListTerminatorsParams struct { 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) @@ -175,48 +191,51 @@ func (o *ListTerminatorsParams) WriteToRequest(r runtime.ClientRequest, reg strf // 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 { diff --git a/rest_client/terminator/list_terminators_responses.go b/rest_management_api_client/terminator/list_terminators_responses.go similarity index 95% rename from rest_client/terminator/list_terminators_responses.go rename to rest_management_api_client/terminator/list_terminators_responses.go index 37a8a14b1..450c436e4 100644 --- a/rest_client/terminator/list_terminators_responses.go +++ b/rest_management_api_client/terminator/list_terminators_responses.go @@ -59,7 +59,6 @@ func (o *ListTerminatorsReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -70,7 +69,7 @@ func NewListTerminatorsOK() *ListTerminatorsOK { return &ListTerminatorsOK{} } -/*ListTerminatorsOK handles this case with default header values. +/* ListTerminatorsOK describes a response with status code 200, with default header values. A list of terminators */ @@ -81,7 +80,6 @@ type ListTerminatorsOK struct { 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 } @@ -103,7 +101,7 @@ func NewListTerminatorsUnauthorized() *ListTerminatorsUnauthorized { return &ListTerminatorsUnauthorized{} } -/*ListTerminatorsUnauthorized handles this case with default header values. +/* 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 */ @@ -114,7 +112,6 @@ type ListTerminatorsUnauthorized struct { 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 } diff --git a/rest_client/terminator/patch_terminator_parameters.go b/rest_management_api_client/terminator/patch_terminator_parameters.go similarity index 80% rename from rest_client/terminator/patch_terminator_parameters.go rename to rest_management_api_client/terminator/patch_terminator_parameters.go index 9209442a5..f0f6c1550 100644 --- a/rest_client/terminator/patch_terminator_parameters.go +++ b/rest_management_api_client/terminator/patch_terminator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewPatchTerminatorParams creates a new PatchTerminatorParams object -// with the default values initialized. +// 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 { - var () return &PatchTerminatorParams{ - timeout: cr.DefaultTimeout, } } // NewPatchTerminatorParamsWithTimeout creates a new PatchTerminatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchTerminatorParamsWithTimeout(timeout time.Duration) *PatchTerminatorParams { - var () return &PatchTerminatorParams{ - timeout: timeout, } } // NewPatchTerminatorParamsWithContext creates a new PatchTerminatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchTerminatorParamsWithContext(ctx context.Context) *PatchTerminatorParams { - var () return &PatchTerminatorParams{ - Context: ctx, } } // NewPatchTerminatorParamsWithHTTPClient creates a new PatchTerminatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchTerminatorParamsWithHTTPClient(client *http.Client) *PatchTerminatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Terminator - A terminator patch object + /* Terminator. + + A terminator patch object */ Terminator *rest_model.TerminatorPatch @@ -102,6 +102,21 @@ type PatchTerminatorParams struct { 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) @@ -169,7 +184,6 @@ func (o *PatchTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strf 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 diff --git a/rest_client/terminator/patch_terminator_responses.go b/rest_management_api_client/terminator/patch_terminator_responses.go similarity index 94% rename from rest_client/terminator/patch_terminator_responses.go rename to rest_management_api_client/terminator/patch_terminator_responses.go index 7922ab92d..fffe295d3 100644 --- a/rest_client/terminator/patch_terminator_responses.go +++ b/rest_management_api_client/terminator/patch_terminator_responses.go @@ -71,7 +71,6 @@ func (o *PatchTerminatorReader) ReadResponse(response runtime.ClientResponse, co 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()) } @@ -82,7 +81,7 @@ func NewPatchTerminatorOK() *PatchTerminatorOK { return &PatchTerminatorOK{} } -/*PatchTerminatorOK handles this case with default header values. +/* PatchTerminatorOK describes a response with status code 200, with default header values. The patch request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type PatchTerminatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewPatchTerminatorBadRequest() *PatchTerminatorBadRequest { return &PatchTerminatorBadRequest{} } -/*PatchTerminatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type PatchTerminatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewPatchTerminatorUnauthorized() *PatchTerminatorUnauthorized { return &PatchTerminatorUnauthorized{} } -/*PatchTerminatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type PatchTerminatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewPatchTerminatorNotFound() *PatchTerminatorNotFound { return &PatchTerminatorNotFound{} } -/*PatchTerminatorNotFound handles this case with default header values. +/* PatchTerminatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type PatchTerminatorNotFound struct { 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 } diff --git a/rest_client/terminator/terminator_client.go b/rest_management_api_client/terminator/terminator_client.go similarity index 84% rename from rest_client/terminator/terminator_client.go rename to rest_management_api_client/terminator/terminator_client.go index 42bc8a829..054e14855 100644 --- a/rest_client/terminator/terminator_client.go +++ b/rest_management_api_client/terminator/terminator_client.go @@ -49,19 +49,22 @@ type Client struct { 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) (*CreateTerminatorCreated, error) + CreateTerminator(params *CreateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTerminatorCreated, error) - DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTerminatorOK, error) + DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTerminatorOK, error) - DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailTerminatorOK, error) + DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTerminatorOK, error) - ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListTerminatorsOK, error) + ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTerminatorsOK, error) - PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchTerminatorOK, error) + PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTerminatorOK, error) - UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateTerminatorOK, error) + UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTerminatorOK, error) SetTransport(transport runtime.ClientTransport) } @@ -71,13 +74,12 @@ type ClientService interface { Create a terminator resource. Requires admin access. */ -func (a *Client) CreateTerminator(params *CreateTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*CreateTerminatorCreated, error) { +func (a *Client) CreateTerminator(params *CreateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTerminatorCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateTerminatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createTerminator", Method: "POST", PathPattern: "/terminators", @@ -89,7 +91,12 @@ func (a *Client) CreateTerminator(params *CreateTerminatorParams, authInfo runti 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 } @@ -108,13 +115,12 @@ func (a *Client) CreateTerminator(params *CreateTerminatorParams, authInfo runti Delete a terminator by id. Requires admin access. */ -func (a *Client) DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTerminatorOK, error) { +func (a *Client) DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTerminatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteTerminatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteTerminator", Method: "DELETE", PathPattern: "/terminators/{id}", @@ -126,7 +132,12 @@ func (a *Client) DeleteTerminator(params *DeleteTerminatorParams, authInfo runti 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 } @@ -145,13 +156,12 @@ func (a *Client) DeleteTerminator(params *DeleteTerminatorParams, authInfo runti Retrieves a single terminator by id. Requires admin access. */ -func (a *Client) DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailTerminatorOK, error) { +func (a *Client) DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTerminatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDetailTerminatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "detailTerminator", Method: "GET", PathPattern: "/terminators/{id}", @@ -163,7 +173,12 @@ func (a *Client) DetailTerminator(params *DetailTerminatorParams, authInfo runti 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 } @@ -183,13 +198,12 @@ func (a *Client) DetailTerminator(params *DetailTerminatorParams, authInfo runti Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access. */ -func (a *Client) ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListTerminatorsOK, error) { +func (a *Client) ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTerminatorsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListTerminatorsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listTerminators", Method: "GET", PathPattern: "/terminators", @@ -201,7 +215,12 @@ func (a *Client) ListTerminators(params *ListTerminatorsParams, authInfo runtime 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 } @@ -220,13 +239,12 @@ func (a *Client) ListTerminators(params *ListTerminatorsParams, authInfo runtime Update the supplied fields on a terminator. Requires admin access. */ -func (a *Client) PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchTerminatorOK, error) { +func (a *Client) PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTerminatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchTerminatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchTerminator", Method: "PATCH", PathPattern: "/terminators/{id}", @@ -238,7 +256,12 @@ func (a *Client) PatchTerminator(params *PatchTerminatorParams, authInfo runtime 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 } @@ -257,13 +280,12 @@ func (a *Client) PatchTerminator(params *PatchTerminatorParams, authInfo runtime Update all fields on a terminator by id. Requires admin access. */ -func (a *Client) UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateTerminatorOK, error) { +func (a *Client) UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTerminatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateTerminatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateTerminator", Method: "PUT", PathPattern: "/terminators/{id}", @@ -275,7 +297,12 @@ func (a *Client) UpdateTerminator(params *UpdateTerminatorParams, authInfo runti 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 } diff --git a/rest_client/terminator/update_terminator_parameters.go b/rest_management_api_client/terminator/update_terminator_parameters.go similarity index 80% rename from rest_client/terminator/update_terminator_parameters.go rename to rest_management_api_client/terminator/update_terminator_parameters.go index b7d87d86a..60c279034 100644 --- a/rest_client/terminator/update_terminator_parameters.go +++ b/rest_management_api_client/terminator/update_terminator_parameters.go @@ -42,58 +42,58 @@ import ( "github.com/openziti/edge/rest_model" ) -// NewUpdateTerminatorParams creates a new UpdateTerminatorParams object -// with the default values initialized. +// 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 { - var () return &UpdateTerminatorParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateTerminatorParamsWithTimeout creates a new UpdateTerminatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateTerminatorParamsWithTimeout(timeout time.Duration) *UpdateTerminatorParams { - var () return &UpdateTerminatorParams{ - timeout: timeout, } } // NewUpdateTerminatorParamsWithContext creates a new UpdateTerminatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateTerminatorParamsWithContext(ctx context.Context) *UpdateTerminatorParams { - var () return &UpdateTerminatorParams{ - Context: ctx, } } // NewUpdateTerminatorParamsWithHTTPClient creates a new UpdateTerminatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateTerminatorParamsWithHTTPClient(client *http.Client) *UpdateTerminatorParams { - var () 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 +/* 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. + The id of the requested resource */ ID string - /*Terminator - A terminator update object + /* Terminator. + + A terminator update object */ Terminator *rest_model.TerminatorUpdate @@ -102,6 +102,21 @@ type UpdateTerminatorParams struct { 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) @@ -169,7 +184,6 @@ func (o *UpdateTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg str 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 diff --git a/rest_client/terminator/update_terminator_responses.go b/rest_management_api_client/terminator/update_terminator_responses.go similarity index 94% rename from rest_client/terminator/update_terminator_responses.go rename to rest_management_api_client/terminator/update_terminator_responses.go index 5c158e0e7..0a7cdb4b3 100644 --- a/rest_client/terminator/update_terminator_responses.go +++ b/rest_management_api_client/terminator/update_terminator_responses.go @@ -71,7 +71,6 @@ func (o *UpdateTerminatorReader) ReadResponse(response runtime.ClientResponse, c 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()) } @@ -82,7 +81,7 @@ func NewUpdateTerminatorOK() *UpdateTerminatorOK { return &UpdateTerminatorOK{} } -/*UpdateTerminatorOK handles this case with default header values. +/* UpdateTerminatorOK describes a response with status code 200, with default header values. The update request was successful and the resource has been altered */ @@ -93,7 +92,6 @@ type UpdateTerminatorOK struct { 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 } @@ -115,7 +113,7 @@ func NewUpdateTerminatorBadRequest() *UpdateTerminatorBadRequest { return &UpdateTerminatorBadRequest{} } -/*UpdateTerminatorBadRequest handles this case with default header values. +/* 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 */ @@ -126,7 +124,6 @@ type UpdateTerminatorBadRequest struct { 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 } @@ -148,7 +145,7 @@ func NewUpdateTerminatorUnauthorized() *UpdateTerminatorUnauthorized { return &UpdateTerminatorUnauthorized{} } -/*UpdateTerminatorUnauthorized handles this case with default header values. +/* 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 */ @@ -159,7 +156,6 @@ type UpdateTerminatorUnauthorized struct { 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 } @@ -181,7 +177,7 @@ func NewUpdateTerminatorNotFound() *UpdateTerminatorNotFound { return &UpdateTerminatorNotFound{} } -/*UpdateTerminatorNotFound handles this case with default header values. +/* UpdateTerminatorNotFound describes a response with status code 404, with default header values. The requested resource does not exist */ @@ -192,7 +188,6 @@ type UpdateTerminatorNotFound struct { 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 } diff --git a/rest_client/ziti_edge_client.go b/rest_management_api_client/ziti_edge_management_client.go similarity index 73% rename from rest_client/ziti_edge_client.go rename to rest_management_api_client/ziti_edge_management_client.go index 53eb4387a..92e916d90 100644 --- a/rest_client/ziti_edge_client.go +++ b/rest_management_api_client/ziti_edge_management_client.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package rest_client +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 @@ -34,33 +34,30 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/openziti/edge/rest_client/api_session" - "github.com/openziti/edge/rest_client/authentication" - "github.com/openziti/edge/rest_client/authenticator" - "github.com/openziti/edge/rest_client/certificate_authority" - "github.com/openziti/edge/rest_client/config" - "github.com/openziti/edge/rest_client/current_api_session" - "github.com/openziti/edge/rest_client/current_identity" - "github.com/openziti/edge/rest_client/database" - "github.com/openziti/edge/rest_client/edge_router" - "github.com/openziti/edge/rest_client/edge_router_policy" - "github.com/openziti/edge/rest_client/enroll" - "github.com/openziti/edge/rest_client/enrollment" - "github.com/openziti/edge/rest_client/geo_region" - "github.com/openziti/edge/rest_client/identity" - "github.com/openziti/edge/rest_client/informational" - "github.com/openziti/edge/rest_client/posture_checks" - "github.com/openziti/edge/rest_client/role_attributes" - "github.com/openziti/edge/rest_client/service" - "github.com/openziti/edge/rest_client/service_edge_router_policy" - "github.com/openziti/edge/rest_client/service_policy" - "github.com/openziti/edge/rest_client/session" - "github.com/openziti/edge/rest_client/terminator" - "github.com/openziti/edge/rest_client/transit_router" - "github.com/openziti/edge/rest_client/well_known" + "github.com/openziti/edge/rest_management_api_client/api_session" + "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/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 HTTP client. +// Default ziti edge management HTTP client. var Default = NewHTTPClient(nil) const ( @@ -69,20 +66,20 @@ const ( DefaultHost string = "demo.ziti.dev" // DefaultBasePath is the default BasePath // found in Meta (info) section of spec file - DefaultBasePath string = "/edge/v1" + 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 HTTP client. -func NewHTTPClient(formats strfmt.Registry) *ZitiEdge { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new ziti edge management HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ZitiEdge { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ZitiEdgeManagement { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -93,14 +90,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Zit return New(transport, formats) } -// New creates a new ziti edge client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *ZitiEdge { +// 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(ZitiEdge) + cli := new(ZitiEdgeManagement) cli.Transport = transport cli.APISession = api_session.New(transport, formats) cli.Authentication = authentication.New(transport, formats) @@ -112,20 +109,17 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *ZitiEdge { cli.Database = database.New(transport, formats) cli.EdgeRouter = edge_router.New(transport, formats) cli.EdgeRouterPolicy = edge_router_policy.New(transport, formats) - cli.Enroll = enroll.New(transport, formats) cli.Enrollment = enrollment.New(transport, formats) - cli.GeoRegion = geo_region.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) - cli.TransitRouter = transit_router.New(transport, formats) - cli.WellKnown = well_known.New(transport, formats) return cli } @@ -168,8 +162,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// ZitiEdge is a client for ziti edge -type ZitiEdge struct { +// ZitiEdgeManagement is a client for ziti edge management +type ZitiEdgeManagement struct { APISession api_session.ClientService Authentication authentication.ClientService @@ -190,12 +184,8 @@ type ZitiEdge struct { EdgeRouterPolicy edge_router_policy.ClientService - Enroll enroll.ClientService - Enrollment enrollment.ClientService - GeoRegion geo_region.ClientService - Identity identity.ClientService Informational informational.ClientService @@ -204,6 +194,8 @@ type ZitiEdge struct { RoleAttributes role_attributes.ClientService + Router router.ClientService + Service service.ClientService ServiceEdgeRouterPolicy service_edge_router_policy.ClientService @@ -214,15 +206,11 @@ type ZitiEdge struct { Terminator terminator.ClientService - TransitRouter transit_router.ClientService - - WellKnown well_known.ClientService - Transport runtime.ClientTransport } // SetTransport changes the transport on the client and all its subresources -func (c *ZitiEdge) SetTransport(transport runtime.ClientTransport) { +func (c *ZitiEdgeManagement) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.APISession.SetTransport(transport) c.Authentication.SetTransport(transport) @@ -234,18 +222,15 @@ func (c *ZitiEdge) SetTransport(transport runtime.ClientTransport) { c.Database.SetTransport(transport) c.EdgeRouter.SetTransport(transport) c.EdgeRouterPolicy.SetTransport(transport) - c.Enroll.SetTransport(transport) c.Enrollment.SetTransport(transport) - c.GeoRegion.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) - c.TransitRouter.SetTransport(transport) - c.WellKnown.SetTransport(transport) } diff --git a/rest_server/configure_ziti_edge.go b/rest_management_api_server/configure_ziti_edge_management.go similarity index 82% rename from rest_server/configure_ziti_edge.go rename to rest_management_api_server/configure_ziti_edge_management.go index fa3b190ed..6e3c46997 100644 --- a/rest_server/configure_ziti_edge.go +++ b/rest_management_api_server/configure_ziti_edge_management.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package rest_server +package rest_management_api_server import ( "crypto/tls" @@ -35,40 +35,37 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" - "github.com/openziti/edge/rest_server/operations" - "github.com/openziti/edge/rest_server/operations/api_session" - "github.com/openziti/edge/rest_server/operations/authentication" - "github.com/openziti/edge/rest_server/operations/authenticator" - "github.com/openziti/edge/rest_server/operations/certificate_authority" - "github.com/openziti/edge/rest_server/operations/config" - "github.com/openziti/edge/rest_server/operations/current_api_session" - "github.com/openziti/edge/rest_server/operations/current_identity" - "github.com/openziti/edge/rest_server/operations/database" - "github.com/openziti/edge/rest_server/operations/edge_router" - "github.com/openziti/edge/rest_server/operations/edge_router_policy" - "github.com/openziti/edge/rest_server/operations/enroll" - "github.com/openziti/edge/rest_server/operations/enrollment" - "github.com/openziti/edge/rest_server/operations/geo_region" - "github.com/openziti/edge/rest_server/operations/identity" - "github.com/openziti/edge/rest_server/operations/informational" - "github.com/openziti/edge/rest_server/operations/posture_checks" - "github.com/openziti/edge/rest_server/operations/role_attributes" - "github.com/openziti/edge/rest_server/operations/service" - "github.com/openziti/edge/rest_server/operations/service_edge_router_policy" - "github.com/openziti/edge/rest_server/operations/service_policy" - "github.com/openziti/edge/rest_server/operations/session" - "github.com/openziti/edge/rest_server/operations/terminator" - "github.com/openziti/edge/rest_server/operations/transit_router" - "github.com/openziti/edge/rest_server/operations/well_known" + "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/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/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 ZitiEdge --spec ../specs/swagger.yml --model-package rest_model --server-package rest_server --principal interface{} --exclude-main +//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.ZitiEdgeAPI) { +func configureFlags(api *operations.ZitiEdgeManagementAPI) { // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } } -func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { +func configureAPI(api *operations.ZitiEdgeManagementAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError @@ -82,27 +79,12 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { // 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.ApplicationJwtProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { return errors.NotImplemented("applicationJwt producer has not yet been implemented") }) - 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 { @@ -121,6 +103,7 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { // // 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") @@ -166,11 +149,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation config.CreateConfigType 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.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") @@ -201,14 +179,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation posture_checks.CreatePostureCheck 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.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 { @@ -226,19 +199,14 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation service_policy.CreateServicePolicy 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.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.TransitRouterCreateTransitRouterHandler == nil { - api.TransitRouterCreateTransitRouterHandler = transit_router.CreateTransitRouterHandlerFunc(func(params transit_router.CreateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.CreateTransitRouter 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 { @@ -271,11 +239,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation config.DeleteConfigType 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.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") @@ -306,6 +269,11 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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") @@ -331,9 +299,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation terminator.DeleteTerminator has not yet been implemented") }) } - if api.TransitRouterDeleteTransitRouterHandler == nil { - api.TransitRouterDeleteTransitRouterHandler = transit_router.DeleteTransitRouterHandlerFunc(func(params transit_router.DeleteTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.DeleteTransitRouter 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 { @@ -361,11 +329,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation config.DetailConfigType 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") @@ -386,11 +349,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation enrollment.DetailEnrollment has not yet been implemented") }) } - if api.GeoRegionDetailGeoRegionHandler == nil { - api.GeoRegionDetailGeoRegionHandler = geo_region.DetailGeoRegionHandlerFunc(func(params geo_region.DetailGeoRegionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation geo_region.DetailGeoRegion 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") @@ -426,6 +384,11 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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") @@ -466,9 +429,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation terminator.DetailTerminator has not yet been implemented") }) } - if api.TransitRouterDetailTransitRouterHandler == nil { - api.TransitRouterDetailTransitRouterHandler = transit_router.DetailTransitRouterHandlerFunc(func(params transit_router.DetailTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.DetailTransitRouter 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.IdentityDisassociateIdentitysServiceConfigsHandler == nil { @@ -476,46 +439,11 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation identity.DisassociateIdentitysServiceConfigs 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.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.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") @@ -536,11 +464,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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.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") @@ -586,11 +509,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation config.ListConfigsForConfigType 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") @@ -646,11 +564,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation enrollment.ListEnrollments has not yet been implemented") }) } - if api.GeoRegionListGeoRegionsHandler == nil { - api.GeoRegionListGeoRegionsHandler = geo_region.ListGeoRegionsHandlerFunc(func(params geo_region.ListGeoRegionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation geo_region.ListGeoRegions 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") @@ -701,16 +614,16 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation posture_checks.ListPostureChecks 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.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") @@ -781,11 +694,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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") @@ -811,9 +719,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation terminator.ListTerminators has not yet been implemented") }) } - if api.TransitRouterListTransitRoutersHandler == nil { - api.TransitRouterListTransitRoutersHandler = transit_router.ListTransitRoutersHandlerFunc(func(params transit_router.ListTransitRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.ListTransitRouters 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 { @@ -821,11 +729,6 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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.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") @@ -871,6 +774,11 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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") @@ -891,9 +799,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation terminator.PatchTerminator has not yet been implemented") }) } - if api.TransitRouterPatchTransitRouterHandler == nil { - api.TransitRouterPatchTransitRouterHandler = transit_router.PatchTransitRouterHandlerFunc(func(params transit_router.PatchTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.PatchTransitRouter 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.IdentityRemoveIdentityMfaHandler == nil { @@ -946,6 +854,11 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { 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") @@ -966,9 +879,9 @@ func configureAPI(api *operations.ZitiEdgeAPI) http.Handler { return middleware.NotImplemented("operation terminator.UpdateTerminator has not yet been implemented") }) } - if api.TransitRouterUpdateTransitRouterHandler == nil { - api.TransitRouterUpdateTransitRouterHandler = transit_router.UpdateTransitRouterHandlerFunc(func(params transit_router.UpdateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.UpdateTransitRouter 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 { @@ -997,18 +910,18 @@ func configureTLS(tlsConfig *tls.Config) { // 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" +// 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 +// 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 +// 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 new file mode 100644 index 000000000..1ba48eebe --- /dev/null +++ b/rest_management_api_server/doc.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// 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 +// +// Schemes: +// https +// Host: demo.ziti.dev +// BasePath: /edge/management/v1 +// Version: 0.19.12 +// Contact: +// +// 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_server/embedded_spec.go b/rest_management_api_server/embedded_spec.go similarity index 68% rename from rest_server/embedded_spec.go rename to rest_management_api_server/embedded_spec.go index 80e41e826..345f8c0d3 100644 --- a/rest_server/embedded_spec.go +++ b/rest_management_api_server/embedded_spec.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package rest_server +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 @@ -53,11778 +53,12 @@ func init() { ], "swagger": "2.0", "info": { - "title": "Ziti Edge", + "title": "Ziti Edge Management", "contact": {}, - "version": "0.16.3" + "version": "0.19.12" }, "host": "demo.ziti.dev", - "basePath": "/edge/v1", - "paths": { - "/": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listRoot", - "responses": { - "200": { - "$ref": "#/responses/listVersion" - } - } - } - }, - "/.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 BjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw FQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD VQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl IEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx ODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI DA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg TmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv dW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC CgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z KIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ NJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa VK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl 7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s 6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb QGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010 XdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU He16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW ghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb ryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw HQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu OuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE gRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS Cpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7 KOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+ rMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X 6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI Fximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN 8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw BHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2 YSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo LLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq dH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB lzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH DAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv dW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5 IFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG A1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy bG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD DIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw HDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f WsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV XO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv pnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD w2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI KyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo 783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm pQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE WFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F 6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa bADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB ACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy 3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY uEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn cCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS WI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg AX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO wEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y qQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m fGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh dprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8 3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA==" - } - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listAPISessions" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailAPISession" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "403": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/detailCurrentAPISession" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "403": { - "$ref": "#/responses/invalidAuthResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/authMethod" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/emptyResponse" - } - } - } - }, - "/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated.\nThis endpoint requries admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "List authenticators", - "operationId": "listAuthenticators", - "responses": { - "200": { - "$ref": "#/responses/listAuthenticators" - } - } - }, - "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": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailAuthenticator" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listCas" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailCa" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listConfigTypes" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailConfigType" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listConfigs" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listConfigs" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailConfig" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Delete a config", - "operationId": "deleteConfig", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/detailCurrentAPISession" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Terminates the current API session", - "tags": [ - "Current API Session" - ], - "summary": "Logout", - "responses": { - "200": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listCurrentApiSessionCertificates" - } - } - }, - "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": { - "$ref": "#/responses/createCurrentApiSessionCertificateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailCurrentApiSessionCertificate" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an ephemeral certificateby id\n", - "tags": [ - "Current API Session" - ], - "summary": "Delete an ephemeral certificate", - "operationId": "deleteCurrentApiSessionCertificate", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listCurrentApiSessionServiceUpdates" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailCurrentIdentity" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listAuthenticators" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailAuthenticator" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listCurrentIdentityEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailMfa" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/alreadyMfaEnrolledResponse" - } - } - }, - "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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/detailMfaRecoveryCodes" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "429": { - "$ref": "#/responses/rateLimitedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/dataIntegrityCheckResult" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "429": { - "$ref": "#/responses/rateLimitedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "429": { - "$ref": "#/responses/rateLimitedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listEdgeRouterPolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailEdgeRouterPolicy" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listIdentities" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listRoleAttributes" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - }, - { - "$ref": "#/parameters/roleFilter" - }, - { - "$ref": "#/parameters/roleSemantic" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailEdgeRouter" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listEdgeRouterPolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listIdentities" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listServicePolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listServices" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/token-optional" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/erottResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/token" - } - ] - }, - "/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 pased 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. 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": { - "$ref": "#/responses/routerExtendEnrollmentResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/zitiSignedCert" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/token" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/token" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/token" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listEnrollments" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailEnrollment" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an outstanding enrollment by id. Requires admin access.", - "tags": [ - "Enrollment" - ], - "summary": "Delete an outstanding enrollment", - "operationId": "deleteEnrollment", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/geo-regions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of geo-regions; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Geo Region" - ], - "summary": "List available geo-regions", - "operationId": "listGeoRegions", - "parameters": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listGeoRegions" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/geo-regions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single geo-region by id. Requires admin access.", - "tags": [ - "Geo Region" - ], - "summary": "Retrieves a geo-region", - "operationId": "detailGeoRegion", - "responses": { - "200": { - "$ref": "#/responses/detailGeoRegion" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - }, - { - "$ref": "#/parameters/roleFilter" - }, - { - "$ref": "#/parameters/roleSemantic" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listIdentities" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailIdentity" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Delete an identity", - "operationId": "deleteIdentity", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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 idenitty", - "operationId": "listIdentitysEdgeRouterPolicies", - "responses": { - "200": { - "$ref": "#/responses/listEdgeRouterPolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/getIdentityFailedServiceRequest" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/getIdentityPolicyAdvice" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - }, - { - "$ref": "#/parameters/serviceId" - } - ] - }, - "/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": { - "$ref": "#/responses/getIdentityPostureData" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listServiceConfigs" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/emptyResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/emptyResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listServicePolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listRoleAttributes" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listIdentityTypes" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailIdentityType" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listPostureCheckTypes" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailPostureCheckType" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - }, - { - "$ref": "#/parameters/roleFilter" - }, - { - "$ref": "#/parameters/roleSemantic" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listPostureChecks" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailPostureCheck" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Deletes and Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Deletes an Posture Checks", - "operationId": "deletePostureCheck", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "403": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/emptyResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/protocols": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Return a list of the listening Edge protocols", - "operationId": "listProtocols", - "responses": { - "200": { - "$ref": "#/responses/listProtocols" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServiceEdgeRouterPolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailServiceEdgePolicy" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listServices" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServicePolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailServicePolicy" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listIdentities" - }, - "400": { - "$ref": "#/responses/notFoundResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listPostureChecks" - }, - "400": { - "$ref": "#/responses/notFoundResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServices" - }, - "400": { - "$ref": "#/responses/notFoundResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listRoleAttributes" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - }, - { - "$ref": "#/parameters/roleFilter" - }, - { - "$ref": "#/parameters/roleSemantic" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServices" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailService" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Delete a service", - "operationId": "deleteService", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listConfigs" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listEdgeRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listIdentities" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServiceEdgeRouterPolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listServicePolicies" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listTerminators" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listSessions" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a session resource. Requires admin access.", - "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": { - "$ref": "#/responses/sessionCreateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailSession" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a session by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Delete a session", - "operationId": "deleteSession", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/detailSessionRoutePath" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listSpecs" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailSpec" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/detailSpecBody" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/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": { - "$ref": "#/responses/listSummaryCounts" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listTerminators" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "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": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/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": { - "$ref": "#/responses/detailTerminator" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "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": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Delete a terminator", - "operationId": "deleteTerminator", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "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": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/transit-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of transit router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Transit Router" - ], - "summary": "List transit routers", - "operationId": "listTransitRouters", - "parameters": [ - { - "$ref": "#/parameters/limit" - }, - { - "$ref": "#/parameters/offset" - }, - { - "$ref": "#/parameters/filter" - } - ], - "responses": { - "200": { - "$ref": "#/responses/listTransitRouters" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a transit router resource. Requires admin access.", - "tags": [ - "Transit Router" - ], - "summary": "Create a transit router resource", - "operationId": "createTransitRouter", - "parameters": [ - { - "description": "A transit router to create", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/transitRouterCreate" - } - } - ], - "responses": { - "201": { - "$ref": "#/responses/createResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - } - } - } - }, - "/transit-routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single transit router by id. Requires admin access.", - "tags": [ - "Transit Router" - ], - "summary": "Retrieves a single transit router", - "operationId": "detailTransitRouter", - "responses": { - "200": { - "$ref": "#/responses/detailTransitRouter" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a transit router by id. Requires admin access.", - "tags": [ - "Transit Router" - ], - "summary": "Update all fields on a transit router", - "operationId": "updateTransitRouter", - "parameters": [ - { - "description": "A transit router update object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/transitRouterUpdate" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/updateResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a transit router by id. Requires admin access.", - "tags": [ - "Transit Router" - ], - "summary": "Delete a transit router", - "operationId": "deleteTransitRouter", - "responses": { - "200": { - "$ref": "#/responses/deleteResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "409": { - "$ref": "#/responses/cannotDeleteReferencedResourceResponse" - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a transit router. Requires admin access.", - "tags": [ - "Transit Router" - ], - "summary": "Update the supplied fields on a transit router", - "operationId": "patchTransitRouter", - "parameters": [ - { - "description": "A transit router patch object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/transitRouterPatch" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/patchResponse" - }, - "400": { - "$ref": "#/responses/badRequestResponse" - }, - "401": { - "$ref": "#/responses/unauthorizedResponse" - }, - "404": { - "$ref": "#/responses/notFoundResponse" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/id" - } - ] - }, - "/version": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listVersion", - "responses": { - "200": { - "$ref": "#/responses/listVersion" - } - } - } - } - }, - "definitions": { - "CurrentApiSessionServiceUpdateList": { - "type": "object", - "required": [ - "lastChangeAt" - ], - "properties": { - "lastChangeAt": { - "type": "string", - "format": "date-time" - } - } - }, - "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" - }, - "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" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaDetail": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckDetail" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaPatch": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckPatch" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaUpdate": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckUpdate" - } - ], - "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", - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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": [ - "path", - "isRunning", - "hash", - "signerFingerprints" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "PROCESS" - }, - "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": { - "type": "string" - } - } - }, - "apiSessionDetail": { - "description": "An API Session object", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "identity", - "identityId", - "configTypes", - "ipAddress", - "authQueries", - "cachedUpdatedAt", - "isMfaRequired", - "isMfaComplete" - ], - "properties": { - "authQueries": { - "$ref": "#/definitions/authQueryList" - }, - "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": { - "mfa": { - "$ref": "#/definitions/postureDataMfa" - } - } - }, - "apiVersion": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "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-omitempty": false - }, - "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": [ - "username", - "password", - "method", - "identityId" - ], - "properties": { - "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/password-nullable" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/username-nullable" - } - } - }, - "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", - "tags" - ], - "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-----" - }, - "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" - }, - "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": { - "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" - } - } - }, - "caUpdate": { - "type": "object", - "required": [ - "name", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles" - ], - "properties": { - "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" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "hostname": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "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" - } - }, - "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" - } - } - }, - "currentAPISessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "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" - } - } - } - ] - }, - "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" - } - }, - "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" - } - } - }, - "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" - } - } - }, - "detailCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - }, - "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" - } - } - }, - "detailGeoRegionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/geoRegionDetail" - }, - "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", - "error" - ], - "properties": { - "error": { - "$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" - } - } - }, - "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" - } - } - }, - "detailSessionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionDetail" - }, - "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" - } - } - }, - "detailTransitRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/transitRouterDetail" - }, - "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" - } - }, - "edgeRouterCreate": { - "description": "An edge router create object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "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": { - "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" - }, - "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" - } - }, - "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", - "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" - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyCreate": { - "required": [ - "name" - ], - "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" - ], - "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" - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "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" - } - } - }, - "enrollmentDetail": { - "description": "An enrollment object. Enrolments are tied to identities and portentially 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": { - "details": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "edgeRouter": { - "$ref": "#/definitions/entityRef" - }, - "edgeRouterId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "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" - } - }, - "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" - } - } - }, - "failedServiceRequestList": { - "type": "array", - "items": { - "$ref": "#/definitions/failedSessionRequest" - } - }, - "failedSessionRequest": { - "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" - } - } - }, - "geoRegionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "geoRegionList": { - "type": "array", - "items": { - "$ref": "#/definitions/geoRegionDetail" - } - }, - "getIdentityFailedServiceRequestEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/failedServiceRequestList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "getIdentityPolicyAdviceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/policyAdvice" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "getIdentityPostureDataEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureData" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityAuthenticators": { - "type": "object", - "properties": { - "cert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "username": { - "type": "string" - } - } - } - } - }, - "identityCreate": { - "description": "An identity to create", - "type": "object", - "required": [ - "name", - "type", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "enrollment": { - "type": "object", - "properties": { - "ott": { - "type": "boolean" - }, - "ottca": { - "type": "string" - }, - "updb": { - "type": "string" - } - } - }, - "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" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authenticators": { - "$ref": "#/definitions/identityAuthenticators" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "enrollment": { - "$ref": "#/definitions/identityEnrollments" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "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" - } - } - } - } - }, - "identityList": { - "description": "A list of identities", - "type": "array", - "items": { - "$ref": "#/definitions/identityDetail" - } - }, - "identityPatch": { - "type": "object", - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "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" - } - } - }, - "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/identityDetail" - } - }, - "identityUpdate": { - "type": "object", - "required": [ - "type", - "name", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "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" - } - } - }, - "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" - } - } - }, - "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" - } - } - }, - "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" - } - } - }, - "listGeoRegionsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/geoRegionList" - }, - "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" - } - } - }, - "listProtocols": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/protocol" - } - }, - "listProtocolsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listProtocols" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listRoleAttributesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/roleAttributesList" - }, - "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" - } - } - }, - "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" - } - } - }, - "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" - } - } - }, - "listTransitRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/transitRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listVersionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/version" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "meta": { - "type": "object", - "properties": { - "apiEnrolmentVersion": { - "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" - } - } - }, - "mfaCreatedEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "mfaFormats": { - "type": "string", - "enum": [ - "numeric", - "alpha", - "alphaNumeric" - ] - }, - "mfaProviders": { - "type": "string", - "enum": [ - "ziti" - ] - }, - "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 - }, - "password-nullable": { - "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" - } - } - }, - "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" - ], - "properties": { - "actualValue": { - "type": "boolean" - }, - "expectedValue": { - "type": "boolean" - } - } - } - ], - "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" - }, - "postureCheckType": { - "type": "string", - "enum": [ - "OS", - "PROCESS", - "PROCESS_MULTI", - "DOMAIN", - "MAC", - "MFA" - ] - }, - "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" - } - } - } - ] - }, - "postureDataMac": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "addresses" - ], - "properties": { - "addresses": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "postureDataMfa": { - "type": "object", - "required": [ - "apiSessionId", - "passedMfa" - ], - "properties": { - "apiSessionId": { - "type": "string" - }, - "passedMfa": { - "type": "boolean" - } - } - }, - "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" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "process": { - "$ref": "#/definitions/postureQueryProcess" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueryProcess" - } - }, - "queryType": { - "$ref": "#/definitions/postureCheckType" - }, - "timeout": { - "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" - } - } - } - }, - "protocol": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - } - }, - "roleAttributesList": { - "description": "An array of role attributes", - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": false - }, - "routerEntityRef": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/entityRef" - }, - { - "type": "object", - "required": [ - "isOnline" - ], - "properties": { - "isOnline": { - "type": "boolean" - } - } - } - ] - }, - "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" - } - } - }, - "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": { - "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": { - "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" - ], - "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" - ], - "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": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "servicePolicyCreate": { - "type": "object", - "required": [ - "name", - "type" - ], - "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" - ], - "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": { - "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" - ], - "properties": { - "apiSession": { - "$ref": "#/definitions/entityRef" - }, - "apiSessionId": { - "type": "string" - }, - "edgeRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionEdgeRouter" - } - }, - "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" - } - }, - "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" - } - }, - "tags": { - "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", - "type": "object", - "additionalProperties": { - "type": "object" - }, - "x-omitempty": false - }, - "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" - } - } - } - ] - }, - "terminatorDetailLimited": { - "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" - } - } - } - ] - }, - "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" - } - } - }, - "transitRouterCreate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "transitRouterDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "isVerified", - "isOnline", - "fingerprint" - ], - "properties": { - "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" - } - } - } - ] - }, - "transitRouterList": { - "type": "array", - "items": { - "$ref": "#/definitions/transitRouterDetail" - } - }, - "transitRouterPatch": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "transitRouterUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "username": { - "type": "string", - "maxLength": 100, - "minLength": 4 - }, - "username-nullable": { - "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" - } - } - } - }, - "parameters": { - "authMethod": { - "enum": [ - "password", - "cert" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - }, - "filter": { - "type": "string", - "name": "filter", - "in": "query" - }, - "id": { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - }, - "limit": { - "type": "integer", - "name": "limit", - "in": "query" - }, - "offset": { - "type": "integer", - "name": "offset", - "in": "query" - }, - "roleFilter": { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - "roleSemantic": { - "type": "string", - "name": "roleSemantic", - "in": "query" - }, - "serviceId": { - "type": "string", - "description": "The id of a service", - "name": "serviceId", - "in": "path", - "required": true - }, - "token": { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - }, - "token-optional": { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query" - } - }, - "responses": { - "alreadyMfaEnrolledResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "badRequestResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "cannotDeleteReferencedResourceResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "createCurrentApiSessionCertificateResponse": { - "description": "A response of a create API Session certificate", - "schema": { - "$ref": "#/definitions/createCurrentApiSessionCertificateEnvelope" - } - }, - "createResponse": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "dataIntegrityCheckResult": { - "description": "A list of data integrity issues found", - "schema": { - "$ref": "#/definitions/dataIntegrityCheckResultEnvelope" - } - }, - "deleteResponse": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "detailAPISession": { - "description": "Retrieves a singular API Session by id", - "schema": { - "$ref": "#/definitions/detailAPISessionEnvelope" - } - }, - "detailAuthenticator": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "detailCa": { - "description": "A singular Certificate Authority (CA) resource", - "schema": { - "$ref": "#/definitions/detailCaEnvelope" - } - }, - "detailConfig": { - "description": "A singular config resource", - "schema": { - "$ref": "#/definitions/detailConfigEnvelope" - } - }, - "detailConfigType": { - "description": "A singular config-type resource", - "schema": { - "$ref": "#/definitions/detailConfigTypeEnvelope" - } - }, - "detailCurrentAPISession": { - "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": {} - } - } - }, - "detailCurrentApiSessionCertificate": { - "description": "A response containing a single API Session certificate", - "schema": { - "$ref": "#/definitions/detailCurrentApiSessionCertificateEnvelope" - } - }, - "detailCurrentIdentity": { - "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": { - "$ref": "#/definitions/attributes" - }, - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "detailEdgeRouter": { - "description": "A singular edge router resource", - "schema": { - "$ref": "#/definitions/detailedEdgeRouterEnvelope" - } - }, - "detailEdgeRouterPolicy": { - "description": "A single edge router policy", - "schema": { - "$ref": "#/definitions/detailEdgeRouterPolicyEnvelope" - } - }, - "detailEnrollment": { - "description": "A singular enrollment resource", - "schema": { - "$ref": "#/definitions/detailEnrollmentEnvelope" - } - }, - "detailGeoRegion": { - "description": "A single geo-region", - "schema": { - "$ref": "#/definitions/detailGeoRegionEnvelope" - } - }, - "detailIdentity": { - "description": "A signle identity", - "schema": { - "$ref": "#/definitions/detailIdentityEnvelope" - } - }, - "detailIdentityType": { - "description": "A single identity type", - "schema": { - "$ref": "#/definitions/detailIdentityTypeEnvelope" - } - }, - "detailMfa": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "detailMfaRecoveryCodes": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "detailPostureCheck": { - "description": "Retrieves a singular posture check by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckEnvelope" - } - }, - "detailPostureCheckType": { - "description": "Retrieves a singular posture check type by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckTypeEnvelope" - } - }, - "detailService": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "detailServiceEdgePolicy": { - "description": "A single service edge router policy", - "schema": { - "$ref": "#/definitions/detailServiceEdgePolicyEnvelope" - } - }, - "detailServicePolicy": { - "description": "A single service policy", - "schema": { - "$ref": "#/definitions/detailServicePolicyEnvelop" - } - }, - "detailSession": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionEnvelope" - } - }, - "detailSessionRoutePath": { - "description": "A single session's route path", - "schema": { - "$ref": "#/definitions/detailSessionRoutePathEnvelope" - } - }, - "detailSpec": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - }, - "detailSpecBody": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - }, - "detailTerminator": { - "description": "A single terminator", - "schema": { - "$ref": "#/definitions/detailTerminatorEnvelope" - } - }, - "detailTransitRouter": { - "description": "A single transit router", - "schema": { - "$ref": "#/definitions/detailTransitRouterEnvelope" - } - }, - "emptyResponse": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "erottResponse": { - "description": "A response containing the edge routers signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "getIdentityFailedServiceRequest": { - "description": "Returns a list of service request failures", - "schema": { - "$ref": "#/definitions/getIdentityFailedServiceRequestEnvelope" - } - }, - "getIdentityPolicyAdvice": { - "description": "Returns the document that represents the policy advice", - "schema": { - "$ref": "#/definitions/getIdentityPolicyAdviceEnvelope" - } - }, - "getIdentityPostureData": { - "description": "Returns the document that represents posture data", - "schema": { - "$ref": "#/definitions/getIdentityPostureDataEnvelope" - } - }, - "invalidAuthResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "listAPISessions": { - "description": "A list of active API Sessions", - "schema": { - "$ref": "#/definitions/listAPISessionsEnvelope" - } - }, - "listAuthenticators": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "listCas": { - "description": "A list of Certificate Authorities (CAs)", - "schema": { - "$ref": "#/definitions/listCasEnvelope" - } - }, - "listConfigTypes": { - "description": "A list of config-types", - "schema": { - "$ref": "#/definitions/listConfigTypesEnvelope" - } - }, - "listConfigs": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "listCurrentApiSessionCertificates": { - "description": "A list of the current API Session's certificate", - "schema": { - "$ref": "#/definitions/listCurrentAPISessionCertificatesEnvelope" - } - }, - "listCurrentApiSessionServiceUpdates": { - "description": "Data indicating necessary service updates", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionServiceUpdatesEnvelope" - } - }, - "listCurrentIdentityEdgeRouters": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listCurrentIdentityEdgeRoutersEnvelope" - } - }, - "listEdgeRouterPolicies": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "listEdgeRouters": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "listEnrollments": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "listGeoRegions": { - "description": "A list of geo-regions", - "schema": { - "$ref": "#/definitions/listGeoRegionsEnvelope" - } - }, - "listIdentities": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "listIdentityTypes": { - "description": "A list of identity types", - "schema": { - "$ref": "#/definitions/listIdentityTypesEnvelope" - } - }, - "listPostureCheckTypes": { - "description": "A list of posture check types", - "schema": { - "$ref": "#/definitions/listPostureCheckTypesEnvelope" - } - }, - "listPostureChecks": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "listProtocols": { - "description": "A list of supported Edge protocols", - "schema": { - "$ref": "#/definitions/listProtocolsEnvelope" - } - }, - "listRoleAttributes": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "listServiceConfigs": { - "description": "A list of service configs", - "schema": { - "$ref": "#/definitions/listServiceConfigsEnvelope" - } - }, - "listServiceEdgeRouterPolicies": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "listServicePolicies": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "listServices": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "listSessions": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsEnvelope" - } - }, - "listSpecs": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - }, - "listSummaryCounts": { - "description": "Entity counts scopped to the current identitie's access", - "schema": { - "$ref": "#/definitions/listSummaryCountsEnvelope" - } - }, - "listTerminators": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "listTransitRouters": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listTransitRoutersEnvelope" - } - }, - "listVersion": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - }, - "mfaCreatedResponse": { - "description": "The create request was succesful and the response contains the location and details to complete MFA enrollment", - "schema": { - "$ref": "#/definitions/mfaCreatedEnvelope" - } - }, - "notFoundResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "patchResponse": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "rateLimitedResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "routerExtendEnrollmentResponse": { - "description": "A response containg the edge routers new signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "sessionCreateResponse": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/sessionCreateEnvelope" - } - }, - "unauthorizedResponse": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "updateResponse": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "zitiSignedCert": { - "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" - } - } - }, - "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": { - "title": "Ziti Edge", - "contact": {}, - "version": "0.16.3" - }, - "host": "demo.ziti.dev", - "basePath": "/edge/v1", + "basePath": "/edge/management/v1", "paths": { "/": { "get": { @@ -11844,29 +78,6 @@ func init() { } } }, - "/.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 BjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw FQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD VQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl IEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx ODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI DA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg TmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv dW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC CgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z KIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ NJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa VK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl 7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s 6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb QGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010 XdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU He16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW ghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb ryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw HQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu OuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE gRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS Cpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7 KOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+ rMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X 6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI Fximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN 8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw BHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2 YSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo LLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq dH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB lzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH DAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv dW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5 IFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG A1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy bG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD DIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw HDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f WsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV XO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv pnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD w2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI KyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo 783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm pQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE WFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F 6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa bADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB ACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy 3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY uEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn cCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS WI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg AX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO wEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y qQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m fGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh dprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8 3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA==" - } - } - } - } - }, "/api-sessions": { "get": { "security": [ @@ -11904,7 +115,7 @@ func init() { "200": { "description": "A list of active API Sessions", "schema": { - "$ref": "#/definitions/listAPISessionsEnvelope" + "$ref": "#/definitions/listApiSessionsEnvelope" } } } @@ -11927,7 +138,7 @@ func init() { "200": { "description": "Retrieves a singular API Session by id", "schema": { - "$ref": "#/definitions/detailAPISessionEnvelope" + "$ref": "#/definitions/detailApiSessionEnvelope" } }, "401": { @@ -12085,7 +296,7 @@ func init() { "200": { "description": "The API session associated with the session used to issue the request", "schema": { - "$ref": "#/definitions/currentAPISessionDetailEnvelope" + "$ref": "#/definitions/currentApiSessionDetailEnvelope" }, "examples": { "default": { @@ -12095,7 +306,7 @@ func init() { "href": "./current-api-session" } }, - "configTypes": [], + "configTypes": null, "createdAt": "2020-03-09T19:03:49.1883693Z", "expiresAt": "2020-03-09T19:34:21.5600897Z", "id": "27343114-b44f-406e-9981-f3c4f2f28d54", @@ -14707,7 +2918,7 @@ func init() { "200": { "description": "The API session associated with the session used to issue the request", "schema": { - "$ref": "#/definitions/currentAPISessionDetailEnvelope" + "$ref": "#/definitions/currentApiSessionDetailEnvelope" }, "examples": { "default": { @@ -14717,7 +2928,7 @@ func init() { "href": "./current-api-session" } }, - "configTypes": [], + "configTypes": null, "createdAt": "2020-03-09T19:03:49.1883693Z", "expiresAt": "2020-03-09T19:34:21.5600897Z", "id": "27343114-b44f-406e-9981-f3c4f2f28d54", @@ -14817,351 +3028,6 @@ func init() { } } }, - "/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" - } - } - } - }, - "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, "/current-identity": { "get": { "security": [ @@ -15206,9 +3072,7 @@ func init() { "isAdmin": true, "isDefaultAdmin": true, "name": "Default Admin", - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, + "roleAttributes": null, "tags": {}, "type": { "_links": { @@ -15637,54 +3501,6 @@ func init() { } ] }, - "/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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, "/current-identity/mfa": { "get": { "security": [ @@ -15923,8 +3739,8 @@ func init() { ], "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" + "image/png", + "application/json" ], "tags": [ "Current Identity", @@ -18194,334 +6010,6 @@ func init() { } ] }, - "/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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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 pased 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. 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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, "/enrollments": { "get": { "security": [ @@ -18750,152 +6238,6 @@ func init() { } ] }, - "/geo-regions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of geo-regions; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Geo Region" - ], - "summary": "List available geo-regions", - "operationId": "listGeoRegions", - "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 geo-regions", - "schema": { - "$ref": "#/definitions/listGeoRegionsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/geo-regions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single geo-region by id. Requires admin access.", - "tags": [ - "Geo Region" - ], - "summary": "Retrieves a geo-region", - "operationId": "detailGeoRegion", - "responses": { - "200": { - "description": "A single geo-region", - "schema": { - "$ref": "#/definitions/detailGeoRegionEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrolmentVersion": "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": { - "apiEnrolmentVersion": "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": [ @@ -19505,7 +6847,7 @@ func init() { "tags": [ "Identity" ], - "summary": "List the edge router policies that affect an idenitty", + "summary": "List the edge router policies that affect an identity", "operationId": "listIdentitysEdgeRouterPolicies", "responses": { "200": { @@ -19675,7 +7017,7 @@ func init() { "200": { "description": "Returns a list of service request failures", "schema": { - "$ref": "#/definitions/getIdentityFailedServiceRequestEnvelope" + "$ref": "#/definitions/failedServiceRequestEnvelope" } }, "401": { @@ -19929,7 +7271,7 @@ func init() { "200": { "description": "Returns the document that represents posture data", "schema": { - "$ref": "#/definitions/getIdentityPostureDataEnvelope" + "$ref": "#/definitions/postureDataEnvelope" } }, "401": { @@ -20887,7 +8229,7 @@ func init() { "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PostureCheckCreate" + "$ref": "#/definitions/postureCheckCreate" } } ], @@ -21053,7 +8395,7 @@ func init() { "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PostureCheckUpdate" + "$ref": "#/definitions/postureCheckUpdate" } } ], @@ -21243,7 +8585,7 @@ func init() { "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PostureCheckPatch" + "$ref": "#/definitions/postureCheckPatch" } } ], @@ -21353,27 +8695,89 @@ func init() { } ] }, - "/posture-response": { + "/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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, "post": { "security": [ { "ztSession": [] } ], - "description": "Submits posture responses", + "description": "Create a router resource. Requires admin access.", "tags": [ - "Posture Checks" + "Router" ], - "summary": "Submit a posture response to a posture query", - "operationId": "createPostureResponse", + "summary": "Create a router resource", + "operationId": "createRouter", "parameters": [ { - "description": "A Posture Response", - "name": "postureResponse", + "description": "A router to create", + "name": "router", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PostureResponseCreate" + "$ref": "#/definitions/routerCreate" } } ], @@ -21448,36 +8852,104 @@ func init() { } } }, - "/posture-response-bulk": { - "post": { + "/routers/{id}": { + "get": { "security": [ { "ztSession": [] } ], - "description": "Submits posture responses", + "description": "Retrieves a single router by id. Requires admin access.", "tags": [ - "Posture Checks" + "Router" ], - "summary": "Submit multiple posture responses", - "operationId": "createPostureResponseBulk", + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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 Posture Response", - "name": "postureResponse", + "description": "A router update object", + "name": "router", "in": "body", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PostureResponseCreate" - } + "$ref": "#/definitions/routerUpdate" } } ], "responses": { "200": { - "description": "Base empty response", + "description": "The update request was successful and the resource has been altered", "schema": { "$ref": "#/definitions/empty" } @@ -21542,27 +9014,270 @@ func init() { } } } - } - } - } - }, - "/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", + }, + "404": { + "description": "The requested resource does not exist", "schema": { - "$ref": "#/definitions/listProtocolsEnvelope" + "$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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { @@ -24355,35 +12070,97 @@ func init() { } } } - }, - "post": { + } + }, + "/sessions/{id}": { + "get": { "security": [ { "ztSession": [] } ], - "description": "Create a session resource. Requires admin access.", + "description": "Retrieves a single session by id. Requires admin access.", "tags": [ "Session" ], - "summary": "Create a session resource", - "operationId": "createSession", - "parameters": [ - { - "description": "A session to create", - "name": "session", - "in": "body", - "required": true, + "summary": "Retrieves a single session", + "operationId": "detailSession", + "responses": { + "200": { + "description": "A single session", "schema": { - "$ref": "#/definitions/sessionCreate" + "$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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", + "200": { + "description": "The delete request was successful and the resource has been removed", "schema": { - "$ref": "#/definitions/sessionCreateEnvelope" + "$ref": "#/definitions/empty" } }, "400": { @@ -24423,6 +12200,18429 @@ func init() { } } }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "type": "string" + } + } + }, + "apiSessionDetail": { + "description": "An API Session object", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/baseEntity" + }, + { + "type": "object", + "required": [ + "token", + "identity", + "identityId", + "configTypes", + "ipAddress", + "authQueries", + "cachedUpdatedAt", + "isMfaRequired", + "isMfaComplete" + ], + "properties": { + "authQueries": { + "$ref": "#/definitions/authQueryList" + }, + "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": { + "mfa": { + "$ref": "#/definitions/postureDataMfa" + } + } + }, + "apiVersion": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "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-omitempty": false + }, + "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": [ + "username", + "password", + "method", + "identityId" + ], + "properties": { + "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", + "tags" + ], + "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" + }, + "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" + }, + "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": { + "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" + } + } + }, + "caUpdate": { + "type": "object", + "required": [ + "name", + "isAutoCaEnrollmentEnabled", + "isOttCaEnrollmentEnabled", + "isAuthEnabled", + "identityRoles" + ], + "properties": { + "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" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "hostname": { + "type": "string" + }, + "isOnline": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "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" + } + } + }, + "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" + } + } + }, + "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", + "error" + ], + "properties": { + "error": { + "$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" + } + } + }, + "detailSessionEnvelope": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/sessionDetail" + }, + "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" + } + }, + "edgeRouterCreate": { + "description": "An edge router create object", + "type": "object", + "required": [ + "name" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "isTunnelerEnabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "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": { + "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" + }, + "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" + } + }, + "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", + "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" + }, + "isTunnelerEnabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "roleAttributes": { + "$ref": "#/definitions/attributes" + }, + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "edgeRouterPolicyCreate": { + "required": [ + "name" + ], + "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" + ], + "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" + }, + "isTunnelerEnabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "roleAttributes": { + "$ref": "#/definitions/attributes" + }, + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "empty": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "type": "object", + "example": {} + }, + "meta": { + "$ref": "#/definitions/meta" + } + } + }, + "enrollmentDetail": { + "description": "An enrollment object. Enrolments are tied to identities and portentially 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": { + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "edgeRouter": { + "$ref": "#/definitions/entityRef" + }, + "edgeRouterId": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "format": "date-time" + }, + "identity": { + "$ref": "#/definitions/entityRef" + }, + "identityId": { + "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" + } + }, + "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" + } + } + }, + "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" + } + } + }, + "updb": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + } + } + } + }, + "identityCreate": { + "description": "An identity to create", + "type": "object", + "required": [ + "name", + "type", + "isAdmin" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "enrollment": { + "type": "object", + "properties": { + "ott": { + "type": "boolean" + }, + "ottca": { + "type": "string" + }, + "updb": { + "type": "string" + } + } + }, + "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" + ], + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "authenticators": { + "$ref": "#/definitions/identityAuthenticators" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "enrollment": { + "$ref": "#/definitions/identityEnrollments" + }, + "envInfo": { + "$ref": "#/definitions/envInfo" + }, + "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" + } + } + } + } + }, + "identityList": { + "description": "A list of identities", + "type": "array", + "items": { + "$ref": "#/definitions/identityDetail" + } + }, + "identityPatch": { + "type": "object", + "properties": { + "appData": { + "$ref": "#/definitions/tags" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "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" + } + } + }, + "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" + }, + "defaultHostingCost": { + "$ref": "#/definitions/terminatorCost" + }, + "defaultHostingPrecedence": { + "$ref": "#/definitions/terminatorPrecedence" + }, + "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" + } + } + }, + "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" + } + } + }, + "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" + } + } + }, + "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" + } + } + }, + "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": { + "apiEnrolmentVersion": { + "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" + ] + }, + "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" + ], + "properties": { + "actualValue": { + "type": "boolean" + }, + "expectedValue": { + "type": "boolean" + } + } + } + ], + "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" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaDetail": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckDetail" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaPatch": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckPatch" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaUpdate": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckUpdate" + } + ], + "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", + "properties": { + "name": { + "type": "string" + }, + "roleAttributes": { + "$ref": "#/definitions/attributes" + }, + "tags": { + "$ref": "#/definitions/tags" + } + }, + "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" + }, + "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" + } + } + } + ] + }, + "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" + ], + "properties": { + "apiSessionId": { + "type": "string" + }, + "passedMfa": { + "type": "boolean" + } + } + }, + "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" + ], + "properties": { + "isPassing": { + "type": "boolean" + }, + "process": { + "$ref": "#/definitions/postureQueryProcess" + }, + "processes": { + "type": "array", + "items": { + "$ref": "#/definitions/postureQueryProcess" + } + }, + "queryType": { + "$ref": "#/definitions/postureCheckType" + }, + "timeout": { + "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" + } + } + } + }, + "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": { + "name": { + "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "routerDetail": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/baseEntity" + }, + { + "type": "object", + "required": [ + "name", + "isVerified", + "isOnline", + "fingerprint" + ], + "properties": { + "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" + } + } + } + ] + }, + "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": { + "name": { + "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "routerUpdate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "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": { + "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": { + "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" + ], + "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" + ], + "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": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "roleAttributes": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "terminatorStrategy": { + "type": "string" + } + } + }, + "servicePolicyCreate": { + "type": "object", + "required": [ + "name", + "type" + ], + "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" + ], + "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": { + "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" + ], + "properties": { + "apiSession": { + "$ref": "#/definitions/entityRef" + }, + "apiSessionId": { + "type": "string" + }, + "edgeRouters": { + "type": "array", + "items": { + "$ref": "#/definitions/sessionEdgeRouter" + } + }, + "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" + } + }, + "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" + } + }, + "tags": { + "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "x-omitempty": false + }, + "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" + } + } + }, + "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": { + "title": "Ziti Edge Management", + "contact": {}, + "version": "0.19.12" + }, + "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" + } + } + } + } + }, + "/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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + }, + "parameters": [ + { + "enum": [ + "password", + "cert" + ], + "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 requries admin access.\n", + "tags": [ + "Authenticator" + ], + "summary": "List authenticators", + "operationId": "listAuthenticators", + "responses": { + "200": { + "description": "A list of authenticators", + "schema": { + "$ref": "#/definitions/listAuthenticatorsEnvelope" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "0.0.1", + "apiVersion": "0.0.1" + } + } + } + } + } + } + }, + "/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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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 signle 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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + } + }, + "/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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + } + } + }, + "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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" + } + }, + "401": { + "description": "The currently supplied session does not have the correct access rights to request this resource", + "schema": { + "$ref": "#/definitions/apiErrorEnvelope" + }, + "examples": { + "application/json": { + "error": { + "args": { + "urlVars": {} + }, + "cause": "", + "causeMessage": "", + "code": "UNAUTHORIZED", + "message": "The request could not be completed. The session is not authorized or the credentials are invalid", + "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" + }, + "meta": { + "apiEnrolmentVersion": "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/listSessionsEnvelope" + } + }, "401": { "description": "The currently supplied session does not have the correct access rights to request this resource", "schema": { @@ -25438,11 +31638,11 @@ func init() { "ztSession": [] } ], - "description": "Retrieves a list of transit router resources; supports filtering, sorting, and pagination. Requires admin access.\n", + "description": "Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access.\n", "tags": [ - "Transit Router" + "Router" ], - "summary": "List transit routers", + "summary": "List routers", "operationId": "listTransitRouters", "parameters": [ { @@ -25465,7 +31665,7 @@ func init() { "200": { "description": "A list of specifications", "schema": { - "$ref": "#/definitions/listTransitRoutersEnvelope" + "$ref": "#/definitions/listRoutersEnvelope" } }, "401": { @@ -25500,20 +31700,20 @@ func init() { "ztSession": [] } ], - "description": "Create a transit router resource. Requires admin access.", + "description": "Create a router resource. Requires admin access.", "tags": [ - "Transit Router" + "Router" ], - "summary": "Create a transit router resource", + "summary": "Create a router resource", "operationId": "createTransitRouter", "parameters": [ { - "description": "A transit router to create", + "description": "A router to create", "name": "router", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/transitRouterCreate" + "$ref": "#/definitions/routerCreate" } } ], @@ -25595,17 +31795,17 @@ func init() { "ztSession": [] } ], - "description": "Retrieves a single transit router by id. Requires admin access.", + "description": "Retrieves a single router by id. Requires admin access.", "tags": [ - "Transit Router" + "Router" ], - "summary": "Retrieves a single transit router", + "summary": "Retrieves a single router", "operationId": "detailTransitRouter", "responses": { "200": { - "description": "A single transit router", + "description": "A single router", "schema": { - "$ref": "#/definitions/detailTransitRouterEnvelope" + "$ref": "#/definitions/detailRouterEnvelope" } }, "401": { @@ -25666,20 +31866,20 @@ func init() { "ztSession": [] } ], - "description": "Update all fields on a transit router by id. Requires admin access.", + "description": "Update all fields on a router by id. Requires admin access.", "tags": [ - "Transit Router" + "Router" ], - "summary": "Update all fields on a transit router", + "summary": "Update all fields on a router", "operationId": "updateTransitRouter", "parameters": [ { - "description": "A transit router update object", + "description": "A router update object", "name": "router", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/transitRouterUpdate" + "$ref": "#/definitions/routerUpdate" } } ], @@ -25785,11 +31985,11 @@ func init() { "ztSession": [] } ], - "description": "Delete a transit router by id. Requires admin access.", + "description": "Delete a router by id. Requires admin access.", "tags": [ - "Transit Router" + "Router" ], - "summary": "Delete a transit router", + "summary": "Delete a router", "operationId": "deleteTransitRouter", "responses": { "200": { @@ -25892,20 +32092,20 @@ func init() { "ztSession": [] } ], - "description": "Update the supplied fields on a transit router. Requires admin access.", + "description": "Update the supplied fields on a router. Requires admin access.", "tags": [ - "Transit Router" + "Router" ], - "summary": "Update the supplied fields on a transit router", + "summary": "Update the supplied fields on a router", "operationId": "patchTransitRouter", "parameters": [ { - "description": "A transit router patch object", + "description": "A router patch object", "name": "router", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/transitRouterPatch" + "$ref": "#/definitions/routerPatch" } } ], @@ -26035,18 +32235,6 @@ func init() { } }, "definitions": { - "CurrentApiSessionServiceUpdateList": { - "type": "object", - "required": [ - "lastChangeAt" - ], - "properties": { - "lastChangeAt": { - "type": "string", - "format": "date-time" - } - } - }, "IdentityAuthenticatorsCert": { "type": "object", "properties": { @@ -26137,737 +32325,6 @@ func init() { } } }, - "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" - }, - "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" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaDetail": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckDetail" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaPatch": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckPatch" - } - ], - "x-class": "MFA" - }, - "PostureCheckMfaUpdate": { - "allOf": [ - { - "$ref": "#/definitions/PostureCheckUpdate" - } - ], - "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", - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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": [ - "path", - "isRunning", - "hash", - "signerFingerprints" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "PROCESS" - }, "apiError": { "type": "object", "properties": { @@ -27180,13 +32637,13 @@ func init() { "type": "object", "properties": { "password": { - "$ref": "#/definitions/password-nullable" + "$ref": "#/definitions/passwordNullable" }, "tags": { "$ref": "#/definitions/tags" }, "username": { - "$ref": "#/definitions/username-nullable" + "$ref": "#/definitions/usernameNullable" } } }, @@ -27293,7 +32750,7 @@ func init() { "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-----" + "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" }, "identityNameFormat": { "type": "string" @@ -27721,20 +33178,6 @@ func init() { "name": "example-config-name" } }, - "createCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateCreateResponse" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "createEnvelope": { "type": "object", "properties": { @@ -27757,96 +33200,6 @@ func init() { } } }, - "currentAPISessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "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", @@ -27872,6 +33225,21 @@ func init() { } ] }, + "currentApiSessionDetailEnvelope": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/currentApiSessionDetail" + }, + "meta": { + "$ref": "#/definitions/meta" + } + } + }, "currentIdentityDetailEnvelope": { "type": "object", "required": [ @@ -27887,25 +33255,6 @@ func init() { } } }, - "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" - } - }, "dataIntegrityCheckDetail": { "type": "object", "required": [ @@ -27979,7 +33328,7 @@ func init() { } } }, - "detailAPISessionEnvelope": { + "detailApiSessionEnvelope": { "type": "object", "required": [ "meta", @@ -28054,20 +33403,6 @@ func init() { } } }, - "detailCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "detailEdgeRouterPolicyEnvelope": { "type": "object", "required": [ @@ -28098,21 +33433,6 @@ func init() { } } }, - "detailGeoRegionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/geoRegionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "detailIdentityEnvelope": { "type": "object", "required": [ @@ -28231,7 +33551,7 @@ func init() { ], "properties": { "data": { - "$ref": "#/definitions/PostureCheckDetail" + "$ref": "#/definitions/postureCheckDetail" }, "meta": { "$ref": "#/definitions/meta" @@ -28246,7 +33566,22 @@ func init() { ], "properties": { "data": { - "$ref": "#/definitions/PostureCheckTypeDetail" + "$ref": "#/definitions/postureCheckTypeDetail" + }, + "meta": { + "$ref": "#/definitions/meta" + } + } + }, + "detailRouterEnvelope": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/routerDetail" }, "meta": { "$ref": "#/definitions/meta" @@ -28373,21 +33708,6 @@ func init() { } } }, - "detailTransitRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/transitRouterDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "detailedEdgeRouterEnvelope": { "type": "object", "required": [ @@ -28710,34 +34030,6 @@ func init() { } } }, - "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" - } - } - }, "enrollmentDetail": { "description": "An enrollment object. Enrolments are tied to identities and portentially 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", @@ -28864,13 +34156,7 @@ func init() { } } }, - "failedServiceRequestList": { - "type": "array", - "items": { - "$ref": "#/definitions/failedSessionRequest" - } - }, - "failedSessionRequest": { + "failedServiceRequest": { "type": "object", "properties": { "apiSessionId": { @@ -28897,32 +34183,7 @@ func init() { } } }, - "geoRegionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "geoRegionList": { - "type": "array", - "items": { - "$ref": "#/definitions/geoRegionDetail" - } - }, - "getIdentityFailedServiceRequestEnvelope": { + "failedServiceRequestEnvelope": { "type": "object", "required": [ "meta", @@ -28937,6 +34198,12 @@ func init() { } } }, + "failedServiceRequestList": { + "type": "array", + "items": { + "$ref": "#/definitions/failedServiceRequest" + } + }, "getIdentityPolicyAdviceEnvelope": { "type": "object", "required": [ @@ -28952,21 +34219,6 @@ func init() { } } }, - "getIdentityPostureDataEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureData" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "identityAuthenticators": { "type": "object", "properties": { @@ -29067,7 +34319,8 @@ func init() { "hasApiSession", "isMfaEnabled", "serviceHostingPrecedences", - "serviceHostingCosts" + "serviceHostingCosts", + "defaultHostingCost" ], "properties": { "appData": { @@ -29263,7 +34516,7 @@ func init() { "identityTypeList": { "type": "array", "items": { - "$ref": "#/definitions/identityDetail" + "$ref": "#/definitions/identityTypeDetail" } }, "identityUpdate": { @@ -29333,7 +34586,7 @@ func init() { }, "x-omitempty": false }, - "listAPISessionsEnvelope": { + "listApiSessionsEnvelope": { "required": [ "meta", "data" @@ -29403,50 +34656,6 @@ func init() { } } }, - "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" - } - } - }, "listEdgeRouterPoliciesEnvelope": { "type": "object", "required": [ @@ -29492,21 +34701,6 @@ func init() { } } }, - "listGeoRegionsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/geoRegionList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "listIdentitiesEnvelope": { "type": "object", "required": [ @@ -29547,7 +34741,7 @@ func init() { "data": { "type": "array", "items": { - "$ref": "#/definitions/PostureCheckDetail" + "$ref": "#/definitions/postureCheckDetail" } }, "meta": { @@ -29563,28 +34757,7 @@ func init() { ], "properties": { "data": { - "$ref": "#/definitions/PostureCheckTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listProtocols": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/protocol" - } - }, - "listProtocolsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listProtocols" + "$ref": "#/definitions/postureCheckTypeList" }, "meta": { "$ref": "#/definitions/meta" @@ -29606,6 +34779,21 @@ func init() { } } }, + "listRoutersEnvelope": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/routerList" + }, + "meta": { + "$ref": "#/definitions/meta" + } + } + }, "listServiceConfigsEnvelope": { "type": "object", "required": [ @@ -29732,21 +34920,6 @@ func init() { } } }, - "listTransitRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/transitRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "listVersionEnvelope": { "type": "object", "required": [ @@ -29794,21 +34967,6 @@ func init() { } } }, - "mfaCreatedEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, "mfaFormats": { "type": "string", "enum": [ @@ -29897,7 +35055,7 @@ func init() { "maxLength": 100, "minLength": 5 }, - "password-nullable": { + "passwordNullable": { "type": "string", "maxLength": 100, "minLength": 5, @@ -29957,6 +35115,163 @@ func init() { } } }, + "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": [ @@ -30181,17 +35496,474 @@ func init() { ], "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" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaDetail": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckDetail" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaPatch": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckPatch" + } + ], + "x-class": "MFA" + }, + "postureCheckMfaUpdate": { + "allOf": [ + { + "$ref": "#/definitions/postureCheckUpdate" + } + ], + "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", + "properties": { + "name": { + "type": "string" + }, + "roleAttributes": { + "$ref": "#/definitions/attributes" + }, + "tags": { + "$ref": "#/definitions/tags" + } + }, + "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", - "PROCESS_MULTI", "DOMAIN", "MAC", - "MFA" + "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" + }, "postureData": { "type": "object", "required": [ @@ -30264,6 +36036,21 @@ func init() { } ] }, + "postureDataEnvelope": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/postureData" + }, + "meta": { + "$ref": "#/definitions/meta" + } + } + }, "postureDataMac": { "type": "object", "allOf": [ @@ -30476,17 +36263,6 @@ func init() { } } }, - "protocol": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - } - }, "roleAttributesList": { "description": "An array of role attributes", "type": "array", @@ -30501,6 +36277,69 @@ func init() { }, "x-omitempty": false }, + "routerCreate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "routerDetail": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/baseEntity" + }, + { + "type": "object", + "required": [ + "name", + "isVerified", + "isOnline", + "fingerprint" + ], + "properties": { + "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" + } + } + } + ] + }, "routerEntityRef": { "type": "object", "allOf": [ @@ -30520,18 +36359,34 @@ func init() { } ] }, - "routerExtendEnrollmentRequest": { + "routerList": { + "type": "array", + "items": { + "$ref": "#/definitions/routerDetail" + } + }, + "routerPatch": { "type": "object", - "required": [ - "serverCertCsr", - "certCsr" - ], "properties": { - "certCsr": { + "name": { "type": "string" }, - "serverCertCsr": { + "tags": { + "$ref": "#/definitions/tags" + } + } + }, + "routerUpdate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { "type": "string" + }, + "tags": { + "$ref": "#/definitions/tags" } } }, @@ -31052,31 +36907,6 @@ func init() { } } }, - "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": [ @@ -31302,37 +37132,6 @@ func init() { } ] }, - "terminatorDetailLimited": { - "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" - } - } - } - ] - }, "terminatorList": { "type": "array", "items": { @@ -31411,106 +37210,12 @@ func init() { } } }, - "transitRouterCreate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "transitRouterDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "isVerified", - "isOnline", - "fingerprint" - ], - "properties": { - "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" - } - } - } - ] - }, - "transitRouterList": { - "type": "array", - "items": { - "$ref": "#/definitions/transitRouterDetail" - } - }, - "transitRouterPatch": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "transitRouterUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, "username": { "type": "string", "maxLength": 100, "minLength": 4 }, - "username-nullable": { + "usernameNullable": { "type": "string", "maxLength": 100, "minLength": 4, @@ -31574,760 +37279,6 @@ func init() { } } }, - "parameters": { - "authMethod": { - "enum": [ - "password", - "cert" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - }, - "filter": { - "type": "string", - "name": "filter", - "in": "query" - }, - "id": { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - }, - "limit": { - "type": "integer", - "name": "limit", - "in": "query" - }, - "offset": { - "type": "integer", - "name": "offset", - "in": "query" - }, - "roleFilter": { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - "roleSemantic": { - "type": "string", - "name": "roleSemantic", - "in": "query" - }, - "serviceId": { - "type": "string", - "description": "The id of a service", - "name": "serviceId", - "in": "path", - "required": true - }, - "token": { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - }, - "token-optional": { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query" - } - }, - "responses": { - "alreadyMfaEnrolledResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "badRequestResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "cannotDeleteReferencedResourceResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "createCurrentApiSessionCertificateResponse": { - "description": "A response of a create API Session certificate", - "schema": { - "$ref": "#/definitions/createCurrentApiSessionCertificateEnvelope" - } - }, - "createResponse": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "dataIntegrityCheckResult": { - "description": "A list of data integrity issues found", - "schema": { - "$ref": "#/definitions/dataIntegrityCheckResultEnvelope" - } - }, - "deleteResponse": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "detailAPISession": { - "description": "Retrieves a singular API Session by id", - "schema": { - "$ref": "#/definitions/detailAPISessionEnvelope" - } - }, - "detailAuthenticator": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "detailCa": { - "description": "A singular Certificate Authority (CA) resource", - "schema": { - "$ref": "#/definitions/detailCaEnvelope" - } - }, - "detailConfig": { - "description": "A singular config resource", - "schema": { - "$ref": "#/definitions/detailConfigEnvelope" - } - }, - "detailConfigType": { - "description": "A singular config-type resource", - "schema": { - "$ref": "#/definitions/detailConfigTypeEnvelope" - } - }, - "detailCurrentAPISession": { - "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": {} - } - } - }, - "detailCurrentApiSessionCertificate": { - "description": "A response containing a single API Session certificate", - "schema": { - "$ref": "#/definitions/detailCurrentApiSessionCertificateEnvelope" - } - }, - "detailCurrentIdentity": { - "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": { - "$ref": "#/definitions/attributes" - }, - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "detailEdgeRouter": { - "description": "A singular edge router resource", - "schema": { - "$ref": "#/definitions/detailedEdgeRouterEnvelope" - } - }, - "detailEdgeRouterPolicy": { - "description": "A single edge router policy", - "schema": { - "$ref": "#/definitions/detailEdgeRouterPolicyEnvelope" - } - }, - "detailEnrollment": { - "description": "A singular enrollment resource", - "schema": { - "$ref": "#/definitions/detailEnrollmentEnvelope" - } - }, - "detailGeoRegion": { - "description": "A single geo-region", - "schema": { - "$ref": "#/definitions/detailGeoRegionEnvelope" - } - }, - "detailIdentity": { - "description": "A signle identity", - "schema": { - "$ref": "#/definitions/detailIdentityEnvelope" - } - }, - "detailIdentityType": { - "description": "A single identity type", - "schema": { - "$ref": "#/definitions/detailIdentityTypeEnvelope" - } - }, - "detailMfa": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "detailMfaRecoveryCodes": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "detailPostureCheck": { - "description": "Retrieves a singular posture check by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckEnvelope" - } - }, - "detailPostureCheckType": { - "description": "Retrieves a singular posture check type by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckTypeEnvelope" - } - }, - "detailService": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "detailServiceEdgePolicy": { - "description": "A single service edge router policy", - "schema": { - "$ref": "#/definitions/detailServiceEdgePolicyEnvelope" - } - }, - "detailServicePolicy": { - "description": "A single service policy", - "schema": { - "$ref": "#/definitions/detailServicePolicyEnvelop" - } - }, - "detailSession": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionEnvelope" - } - }, - "detailSessionRoutePath": { - "description": "A single session's route path", - "schema": { - "$ref": "#/definitions/detailSessionRoutePathEnvelope" - } - }, - "detailSpec": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - }, - "detailSpecBody": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - }, - "detailTerminator": { - "description": "A single terminator", - "schema": { - "$ref": "#/definitions/detailTerminatorEnvelope" - } - }, - "detailTransitRouter": { - "description": "A single transit router", - "schema": { - "$ref": "#/definitions/detailTransitRouterEnvelope" - } - }, - "emptyResponse": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "erottResponse": { - "description": "A response containing the edge routers signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "getIdentityFailedServiceRequest": { - "description": "Returns a list of service request failures", - "schema": { - "$ref": "#/definitions/getIdentityFailedServiceRequestEnvelope" - } - }, - "getIdentityPolicyAdvice": { - "description": "Returns the document that represents the policy advice", - "schema": { - "$ref": "#/definitions/getIdentityPolicyAdviceEnvelope" - } - }, - "getIdentityPostureData": { - "description": "Returns the document that represents posture data", - "schema": { - "$ref": "#/definitions/getIdentityPostureDataEnvelope" - } - }, - "invalidAuthResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "listAPISessions": { - "description": "A list of active API Sessions", - "schema": { - "$ref": "#/definitions/listAPISessionsEnvelope" - } - }, - "listAuthenticators": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "listCas": { - "description": "A list of Certificate Authorities (CAs)", - "schema": { - "$ref": "#/definitions/listCasEnvelope" - } - }, - "listConfigTypes": { - "description": "A list of config-types", - "schema": { - "$ref": "#/definitions/listConfigTypesEnvelope" - } - }, - "listConfigs": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "listCurrentApiSessionCertificates": { - "description": "A list of the current API Session's certificate", - "schema": { - "$ref": "#/definitions/listCurrentAPISessionCertificatesEnvelope" - } - }, - "listCurrentApiSessionServiceUpdates": { - "description": "Data indicating necessary service updates", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionServiceUpdatesEnvelope" - } - }, - "listCurrentIdentityEdgeRouters": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listCurrentIdentityEdgeRoutersEnvelope" - } - }, - "listEdgeRouterPolicies": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "listEdgeRouters": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "listEnrollments": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "listGeoRegions": { - "description": "A list of geo-regions", - "schema": { - "$ref": "#/definitions/listGeoRegionsEnvelope" - } - }, - "listIdentities": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "listIdentityTypes": { - "description": "A list of identity types", - "schema": { - "$ref": "#/definitions/listIdentityTypesEnvelope" - } - }, - "listPostureCheckTypes": { - "description": "A list of posture check types", - "schema": { - "$ref": "#/definitions/listPostureCheckTypesEnvelope" - } - }, - "listPostureChecks": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "listProtocols": { - "description": "A list of supported Edge protocols", - "schema": { - "$ref": "#/definitions/listProtocolsEnvelope" - } - }, - "listRoleAttributes": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "listServiceConfigs": { - "description": "A list of service configs", - "schema": { - "$ref": "#/definitions/listServiceConfigsEnvelope" - } - }, - "listServiceEdgeRouterPolicies": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "listServicePolicies": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "listServices": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "listSessions": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsEnvelope" - } - }, - "listSpecs": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - }, - "listSummaryCounts": { - "description": "Entity counts scopped to the current identitie's access", - "schema": { - "$ref": "#/definitions/listSummaryCountsEnvelope" - } - }, - "listTerminators": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "listTransitRouters": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listTransitRoutersEnvelope" - } - }, - "listVersion": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - }, - "mfaCreatedResponse": { - "description": "The create request was succesful and the response contains the location and details to complete MFA enrollment", - "schema": { - "$ref": "#/definitions/mfaCreatedEnvelope" - } - }, - "notFoundResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "patchResponse": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "rateLimitedResponse": { - "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": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "routerExtendEnrollmentResponse": { - "description": "A response containg the edge routers new signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "sessionCreateResponse": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/sessionCreateEnvelope" - } - }, - "unauthorizedResponse": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrolmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "updateResponse": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "zitiSignedCert": { - "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" - } - } - }, "securityDefinitions": { "ztSession": { "description": "An API Key that is provided post authentication", diff --git a/rest_server/operations/api_session/delete_api_sessions.go b/rest_management_api_server/operations/api_session/delete_api_sessions.go similarity index 93% rename from rest_server/operations/api_session/delete_api_sessions.go rename to rest_management_api_server/operations/api_session/delete_api_sessions.go index 9f7788742..1c9f62712 100644 --- a/rest_server/operations/api_session/delete_api_sessions.go +++ b/rest_management_api_server/operations/api_session/delete_api_sessions.go @@ -53,7 +53,7 @@ func NewDeleteAPISessions(ctx *middleware.Context, handler DeleteAPISessionsHand return &DeleteAPISessions{Context: ctx, Handler: handler} } -/*DeleteAPISessions swagger:route DELETE /api-sessions/{id} API Session deleteApiSessions +/* DeleteAPISessions swagger:route DELETE /api-sessions/{id} API Session deleteApiSessions Deletes an API Sessions @@ -68,21 +68,20 @@ type DeleteAPISessions struct { func (o *DeleteAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/api_session/delete_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go similarity index 98% rename from rest_server/operations/api_session/delete_api_sessions_parameters.go rename to rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go index 9022a7f39..445bea430 100644 --- a/rest_server/operations/api_session/delete_api_sessions_parameters.go +++ b/rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteAPISessionsParams creates a new DeleteAPISessionsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteAPISessionsParams() DeleteAPISessionsParams { return DeleteAPISessionsParams{} @@ -73,7 +74,6 @@ func (o *DeleteAPISessionsParams) BindRequest(r *http.Request, route *middleware if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteAPISessionsParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/api_session/delete_api_sessions_responses.go b/rest_management_api_server/operations/api_session/delete_api_sessions_responses.go similarity index 100% rename from rest_server/operations/api_session/delete_api_sessions_responses.go rename to rest_management_api_server/operations/api_session/delete_api_sessions_responses.go diff --git a/rest_server/operations/api_session/delete_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go similarity index 98% rename from rest_server/operations/api_session/delete_api_sessions_urlbuilder.go rename to rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go index c049b57ae..d5f3486ed 100644 --- a/rest_server/operations/api_session/delete_api_sessions_urlbuilder.go +++ b/rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteAPISessionsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/api_session/detail_api_sessions.go b/rest_management_api_server/operations/api_session/detail_api_sessions.go similarity index 93% rename from rest_server/operations/api_session/detail_api_sessions.go rename to rest_management_api_server/operations/api_session/detail_api_sessions.go index 40fa9fe10..350fd64a6 100644 --- a/rest_server/operations/api_session/detail_api_sessions.go +++ b/rest_management_api_server/operations/api_session/detail_api_sessions.go @@ -53,7 +53,7 @@ func NewDetailAPISessions(ctx *middleware.Context, handler DetailAPISessionsHand return &DetailAPISessions{Context: ctx, Handler: handler} } -/*DetailAPISessions swagger:route GET /api-sessions/{id} API Session detailApiSessions +/* DetailAPISessions swagger:route GET /api-sessions/{id} API Session detailApiSessions Retrieves a single API Session @@ -68,21 +68,20 @@ type DetailAPISessions struct { func (o *DetailAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/api_session/detail_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go similarity index 98% rename from rest_server/operations/api_session/detail_api_sessions_parameters.go rename to rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go index fa392bc63..f63c08f24 100644 --- a/rest_server/operations/api_session/detail_api_sessions_parameters.go +++ b/rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailAPISessionsParams creates a new DetailAPISessionsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailAPISessionsParams() DetailAPISessionsParams { return DetailAPISessionsParams{} @@ -73,7 +74,6 @@ func (o *DetailAPISessionsParams) BindRequest(r *http.Request, route *middleware if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailAPISessionsParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/api_session/detail_api_sessions_responses.go b/rest_management_api_server/operations/api_session/detail_api_sessions_responses.go similarity index 100% rename from rest_server/operations/api_session/detail_api_sessions_responses.go rename to rest_management_api_server/operations/api_session/detail_api_sessions_responses.go diff --git a/rest_server/operations/api_session/detail_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go similarity index 98% rename from rest_server/operations/api_session/detail_api_sessions_urlbuilder.go rename to rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go index 9f42eb3d1..5ad2ec282 100644 --- a/rest_server/operations/api_session/detail_api_sessions_urlbuilder.go +++ b/rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailAPISessionsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/api_session/list_api_sessions.go b/rest_management_api_server/operations/api_session/list_api_sessions.go similarity index 94% rename from rest_server/operations/api_session/list_api_sessions.go rename to rest_management_api_server/operations/api_session/list_api_sessions.go index 0a564649d..25cdb1702 100644 --- a/rest_server/operations/api_session/list_api_sessions.go +++ b/rest_management_api_server/operations/api_session/list_api_sessions.go @@ -53,7 +53,7 @@ func NewListAPISessions(ctx *middleware.Context, handler ListAPISessionsHandler) return &ListAPISessions{Context: ctx, Handler: handler} } -/*ListAPISessions swagger:route GET /api-sessions API Session listApiSessions +/* ListAPISessions swagger:route GET /api-sessions API Session listApiSessions List active API sessions @@ -70,21 +70,20 @@ type ListAPISessions struct { func (o *ListAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *ListAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/api_session/list_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/list_api_sessions_parameters.go similarity index 98% rename from rest_server/operations/api_session/list_api_sessions_parameters.go rename to rest_management_api_server/operations/api_session/list_api_sessions_parameters.go index b40ccf747..ee122d47b 100644 --- a/rest_server/operations/api_session/list_api_sessions_parameters.go +++ b/rest_management_api_server/operations/api_session/list_api_sessions_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListAPISessionsParams creates a new ListAPISessionsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListAPISessionsParams() ListAPISessionsParams { return ListAPISessionsParams{} @@ -94,7 +95,6 @@ func (o *ListAPISessionsParams) BindRequest(r *http.Request, route *middleware.M if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListAPISessionsParams) bindFilter(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListAPISessionsParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListAPISessionsParams) bindOffset(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/api_session/list_api_sessions_responses.go b/rest_management_api_server/operations/api_session/list_api_sessions_responses.go similarity index 100% rename from rest_server/operations/api_session/list_api_sessions_responses.go rename to rest_management_api_server/operations/api_session/list_api_sessions_responses.go diff --git a/rest_server/operations/api_session/list_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go similarity index 99% rename from rest_server/operations/api_session/list_api_sessions_urlbuilder.go rename to rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go index 9f023cf52..636852c16 100644 --- a/rest_server/operations/api_session/list_api_sessions_urlbuilder.go +++ b/rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListAPISessionsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/authentication/authenticate.go b/rest_management_api_server/operations/authentication/authenticate.go new file mode 100644 index 000000000..7b38405a1 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/geo_region/detail_geo_region.go b/rest_management_api_server/operations/authentication/authenticate_mfa.go similarity index 61% rename from rest_server/operations/geo_region/detail_geo_region.go rename to rest_management_api_server/operations/authentication/authenticate_mfa.go index aa06f2350..5e4daef70 100644 --- a/rest_server/operations/geo_region/detail_geo_region.go +++ b/rest_management_api_server/operations/authentication/authenticate_mfa.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package authentication // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -35,54 +35,53 @@ import ( "github.com/go-openapi/runtime/middleware" ) -// DetailGeoRegionHandlerFunc turns a function with the right signature into a detail geo region handler -type DetailGeoRegionHandlerFunc func(DetailGeoRegionParams, interface{}) middleware.Responder +// 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 DetailGeoRegionHandlerFunc) Handle(params DetailGeoRegionParams, principal interface{}) middleware.Responder { +func (fn AuthenticateMfaHandlerFunc) Handle(params AuthenticateMfaParams, principal interface{}) middleware.Responder { return fn(params, principal) } -// DetailGeoRegionHandler interface for that can handle valid detail geo region params -type DetailGeoRegionHandler interface { - Handle(DetailGeoRegionParams, interface{}) middleware.Responder +// AuthenticateMfaHandler interface for that can handle valid authenticate mfa params +type AuthenticateMfaHandler interface { + Handle(AuthenticateMfaParams, interface{}) middleware.Responder } -// NewDetailGeoRegion creates a new http.Handler for the detail geo region operation -func NewDetailGeoRegion(ctx *middleware.Context, handler DetailGeoRegionHandler) *DetailGeoRegion { - return &DetailGeoRegion{Context: ctx, Handler: handler} +// 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} } -/*DetailGeoRegion swagger:route GET /geo-regions/{id} Geo Region detailGeoRegion +/* AuthenticateMfa swagger:route POST /authenticate/mfa Authentication MFA authenticateMfa -Retrieves a geo-region +Complete MFA authentication -Retrieves a single geo-region by id. Requires admin access. +Completes MFA authentication by submitting a MFA time based one time token or backup code. */ -type DetailGeoRegion struct { +type AuthenticateMfa struct { Context *middleware.Context - Handler DetailGeoRegionHandler + Handler AuthenticateMfaHandler } -func (o *DetailGeoRegion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { +func (o *AuthenticateMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *r = *rCtx } - var Params = NewDetailGeoRegionParams() - + 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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailGeoRegion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } 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 new file mode 100644 index 000000000..f5e4af083 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_mfa_parameters.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1458066c6 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_mfa_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..cface2659 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_mfa_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..89e2ca121 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_parameters.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"}, 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 new file mode 100644 index 000000000..8cb1f61d6 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..89382c1e6 --- /dev/null +++ b/rest_management_api_server/operations/authentication/authenticate_urlbuilder.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/authenticator/create_authenticator.go b/rest_management_api_server/operations/authenticator/create_authenticator.go similarity index 93% rename from rest_server/operations/authenticator/create_authenticator.go rename to rest_management_api_server/operations/authenticator/create_authenticator.go index a51d385aa..05a00c9b8 100644 --- a/rest_server/operations/authenticator/create_authenticator.go +++ b/rest_management_api_server/operations/authenticator/create_authenticator.go @@ -53,7 +53,7 @@ func NewCreateAuthenticator(ctx *middleware.Context, handler CreateAuthenticator return &CreateAuthenticator{Context: ctx, Handler: handler} } -/*CreateAuthenticator swagger:route POST /authenticators Authenticator createAuthenticator +/* CreateAuthenticator swagger:route POST /authenticators Authenticator createAuthenticator Creates an authenticator @@ -69,21 +69,20 @@ type CreateAuthenticator struct { func (o *CreateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *CreateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/create_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/create_authenticator_parameters.go similarity index 92% rename from rest_server/operations/authenticator/create_authenticator_parameters.go rename to rest_management_api_server/operations/authenticator/create_authenticator_parameters.go index 305b07d05..9f4e5a478 100644 --- a/rest_server/operations/authenticator/create_authenticator_parameters.go +++ b/rest_management_api_server/operations/authenticator/create_authenticator_parameters.go @@ -30,18 +30,21 @@ package authenticator // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateAuthenticatorParams() CreateAuthenticatorParams { return CreateAuthenticatorParams{} @@ -87,6 +90,11 @@ func (o *CreateAuthenticatorParams) BindRequest(r *http.Request, route *middlewa 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 } diff --git a/rest_server/operations/authenticator/create_authenticator_responses.go b/rest_management_api_server/operations/authenticator/create_authenticator_responses.go similarity index 100% rename from rest_server/operations/authenticator/create_authenticator_responses.go rename to rest_management_api_server/operations/authenticator/create_authenticator_responses.go diff --git a/rest_server/operations/authenticator/create_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/create_authenticator_urlbuilder.go rename to rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go index 3eab71e39..1ad8d4567 100644 --- a/rest_server/operations/authenticator/create_authenticator_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authenticator/delete_authenticator.go b/rest_management_api_server/operations/authenticator/delete_authenticator.go similarity index 93% rename from rest_server/operations/authenticator/delete_authenticator.go rename to rest_management_api_server/operations/authenticator/delete_authenticator.go index 6eb6cd6ae..3824b2508 100644 --- a/rest_server/operations/authenticator/delete_authenticator.go +++ b/rest_management_api_server/operations/authenticator/delete_authenticator.go @@ -53,7 +53,7 @@ func NewDeleteAuthenticator(ctx *middleware.Context, handler DeleteAuthenticator return &DeleteAuthenticator{Context: ctx, Handler: handler} } -/*DeleteAuthenticator swagger:route DELETE /authenticators/{id} Authenticator deleteAuthenticator +/* DeleteAuthenticator swagger:route DELETE /authenticators/{id} Authenticator deleteAuthenticator Delete an Authenticator @@ -70,21 +70,20 @@ type DeleteAuthenticator struct { func (o *DeleteAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *DeleteAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/delete_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go similarity index 98% rename from rest_server/operations/authenticator/delete_authenticator_parameters.go rename to rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go index 290109ea5..a05f3c845 100644 --- a/rest_server/operations/authenticator/delete_authenticator_parameters.go +++ b/rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteAuthenticatorParams creates a new DeleteAuthenticatorParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteAuthenticatorParams() DeleteAuthenticatorParams { return DeleteAuthenticatorParams{} @@ -73,7 +74,6 @@ func (o *DeleteAuthenticatorParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteAuthenticatorParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/authenticator/delete_authenticator_responses.go b/rest_management_api_server/operations/authenticator/delete_authenticator_responses.go similarity index 100% rename from rest_server/operations/authenticator/delete_authenticator_responses.go rename to rest_management_api_server/operations/authenticator/delete_authenticator_responses.go diff --git a/rest_server/operations/authenticator/delete_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/delete_authenticator_urlbuilder.go rename to rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go index c2b72084d..22fc32697 100644 --- a/rest_server/operations/authenticator/delete_authenticator_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authenticator/detail_authenticator.go b/rest_management_api_server/operations/authenticator/detail_authenticator.go similarity index 93% rename from rest_server/operations/authenticator/detail_authenticator.go rename to rest_management_api_server/operations/authenticator/detail_authenticator.go index 3b02e2b97..6e74b8a13 100644 --- a/rest_server/operations/authenticator/detail_authenticator.go +++ b/rest_management_api_server/operations/authenticator/detail_authenticator.go @@ -53,7 +53,7 @@ func NewDetailAuthenticator(ctx *middleware.Context, handler DetailAuthenticator return &DetailAuthenticator{Context: ctx, Handler: handler} } -/*DetailAuthenticator swagger:route GET /authenticators/{id} Authenticator detailAuthenticator +/* DetailAuthenticator swagger:route GET /authenticators/{id} Authenticator detailAuthenticator Retrieves a single authenticator @@ -68,21 +68,20 @@ type DetailAuthenticator struct { func (o *DetailAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/detail_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go similarity index 98% rename from rest_server/operations/authenticator/detail_authenticator_parameters.go rename to rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go index f0382086b..55ae15340 100644 --- a/rest_server/operations/authenticator/detail_authenticator_parameters.go +++ b/rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailAuthenticatorParams creates a new DetailAuthenticatorParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailAuthenticatorParams() DetailAuthenticatorParams { return DetailAuthenticatorParams{} @@ -73,7 +74,6 @@ func (o *DetailAuthenticatorParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailAuthenticatorParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/authenticator/detail_authenticator_responses.go b/rest_management_api_server/operations/authenticator/detail_authenticator_responses.go similarity index 100% rename from rest_server/operations/authenticator/detail_authenticator_responses.go rename to rest_management_api_server/operations/authenticator/detail_authenticator_responses.go diff --git a/rest_server/operations/authenticator/detail_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/detail_authenticator_urlbuilder.go rename to rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go index 5a25a21b4..9ddfaa495 100644 --- a/rest_server/operations/authenticator/detail_authenticator_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authenticator/list_authenticators.go b/rest_management_api_server/operations/authenticator/list_authenticators.go similarity index 94% rename from rest_server/operations/authenticator/list_authenticators.go rename to rest_management_api_server/operations/authenticator/list_authenticators.go index 44d021ff6..05196b678 100644 --- a/rest_server/operations/authenticator/list_authenticators.go +++ b/rest_management_api_server/operations/authenticator/list_authenticators.go @@ -53,7 +53,7 @@ func NewListAuthenticators(ctx *middleware.Context, handler ListAuthenticatorsHa return &ListAuthenticators{Context: ctx, Handler: handler} } -/*ListAuthenticators swagger:route GET /authenticators Authenticator listAuthenticators +/* ListAuthenticators swagger:route GET /authenticators Authenticator listAuthenticators List authenticators @@ -70,21 +70,20 @@ type ListAuthenticators struct { func (o *ListAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *ListAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/list_authenticators_parameters.go b/rest_management_api_server/operations/authenticator/list_authenticators_parameters.go similarity index 97% rename from rest_server/operations/authenticator/list_authenticators_parameters.go rename to rest_management_api_server/operations/authenticator/list_authenticators_parameters.go index dbdceb569..7aafd7e03 100644 --- a/rest_server/operations/authenticator/list_authenticators_parameters.go +++ b/rest_management_api_server/operations/authenticator/list_authenticators_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListAuthenticatorsParams creates a new ListAuthenticatorsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListAuthenticatorsParams() ListAuthenticatorsParams { return ListAuthenticatorsParams{} diff --git a/rest_server/operations/authenticator/list_authenticators_responses.go b/rest_management_api_server/operations/authenticator/list_authenticators_responses.go similarity index 100% rename from rest_server/operations/authenticator/list_authenticators_responses.go rename to rest_management_api_server/operations/authenticator/list_authenticators_responses.go diff --git a/rest_server/operations/authenticator/list_authenticators_urlbuilder.go b/rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/list_authenticators_urlbuilder.go rename to rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go index 9ccc4305f..0f121cd32 100644 --- a/rest_server/operations/authenticator/list_authenticators_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListAuthenticatorsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authenticator/patch_authenticator.go b/rest_management_api_server/operations/authenticator/patch_authenticator.go similarity index 93% rename from rest_server/operations/authenticator/patch_authenticator.go rename to rest_management_api_server/operations/authenticator/patch_authenticator.go index ad4d8921a..bc79cbce2 100644 --- a/rest_server/operations/authenticator/patch_authenticator.go +++ b/rest_management_api_server/operations/authenticator/patch_authenticator.go @@ -53,7 +53,7 @@ func NewPatchAuthenticator(ctx *middleware.Context, handler PatchAuthenticatorHa return &PatchAuthenticator{Context: ctx, Handler: handler} } -/*PatchAuthenticator swagger:route PATCH /authenticators/{id} Authenticator patchAuthenticator +/* PatchAuthenticator swagger:route PATCH /authenticators/{id} Authenticator patchAuthenticator Update the supplied fields on an authenticator @@ -68,21 +68,20 @@ type PatchAuthenticator struct { func (o *PatchAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/patch_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go similarity index 93% rename from rest_server/operations/authenticator/patch_authenticator_parameters.go rename to rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go index 256e5d6b5..f4b2128b4 100644 --- a/rest_server/operations/authenticator/patch_authenticator_parameters.go +++ b/rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go @@ -30,6 +30,7 @@ package authenticator // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchAuthenticatorParams() PatchAuthenticatorParams { return PatchAuthenticatorParams{} @@ -93,6 +96,11 @@ func (o *PatchAuthenticatorParams) BindRequest(r *http.Request, route *middlewar 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 } @@ -100,11 +108,11 @@ func (o *PatchAuthenticatorParams) BindRequest(r *http.Request, route *middlewar } 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...) } @@ -120,7 +128,6 @@ func (o *PatchAuthenticatorParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/authenticator/patch_authenticator_responses.go b/rest_management_api_server/operations/authenticator/patch_authenticator_responses.go similarity index 100% rename from rest_server/operations/authenticator/patch_authenticator_responses.go rename to rest_management_api_server/operations/authenticator/patch_authenticator_responses.go diff --git a/rest_server/operations/authenticator/patch_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/patch_authenticator_urlbuilder.go rename to rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go index dbb63a1a3..5fd0828b7 100644 --- a/rest_server/operations/authenticator/patch_authenticator_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/authenticator/update_authenticator.go b/rest_management_api_server/operations/authenticator/update_authenticator.go similarity index 93% rename from rest_server/operations/authenticator/update_authenticator.go rename to rest_management_api_server/operations/authenticator/update_authenticator.go index 1d38480c4..c9cfee50e 100644 --- a/rest_server/operations/authenticator/update_authenticator.go +++ b/rest_management_api_server/operations/authenticator/update_authenticator.go @@ -53,7 +53,7 @@ func NewUpdateAuthenticator(ctx *middleware.Context, handler UpdateAuthenticator return &UpdateAuthenticator{Context: ctx, Handler: handler} } -/*UpdateAuthenticator swagger:route PUT /authenticators/{id} Authenticator updateAuthenticator +/* UpdateAuthenticator swagger:route PUT /authenticators/{id} Authenticator updateAuthenticator Update all fields on an authenticator @@ -68,21 +68,20 @@ type UpdateAuthenticator struct { func (o *UpdateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/authenticator/update_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/update_authenticator_parameters.go similarity index 93% rename from rest_server/operations/authenticator/update_authenticator_parameters.go rename to rest_management_api_server/operations/authenticator/update_authenticator_parameters.go index 1caa40d23..03be1050e 100644 --- a/rest_server/operations/authenticator/update_authenticator_parameters.go +++ b/rest_management_api_server/operations/authenticator/update_authenticator_parameters.go @@ -30,6 +30,7 @@ package authenticator // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateAuthenticatorParams() UpdateAuthenticatorParams { return UpdateAuthenticatorParams{} @@ -93,6 +96,11 @@ func (o *UpdateAuthenticatorParams) BindRequest(r *http.Request, route *middlewa 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 } @@ -100,11 +108,11 @@ func (o *UpdateAuthenticatorParams) BindRequest(r *http.Request, route *middlewa } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateAuthenticatorParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/authenticator/update_authenticator_responses.go b/rest_management_api_server/operations/authenticator/update_authenticator_responses.go similarity index 100% rename from rest_server/operations/authenticator/update_authenticator_responses.go rename to rest_management_api_server/operations/authenticator/update_authenticator_responses.go diff --git a/rest_server/operations/authenticator/update_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go similarity index 98% rename from rest_server/operations/authenticator/update_authenticator_urlbuilder.go rename to rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go index 68e452554..f1e54e9d2 100644 --- a/rest_server/operations/authenticator/update_authenticator_urlbuilder.go +++ b/rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateAuthenticatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/create_ca.go b/rest_management_api_server/operations/certificate_authority/create_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/create_ca.go rename to rest_management_api_server/operations/certificate_authority/create_ca.go index 9b1ca2531..a5ec28b0b 100644 --- a/rest_server/operations/certificate_authority/create_ca.go +++ b/rest_management_api_server/operations/certificate_authority/create_ca.go @@ -53,7 +53,7 @@ func NewCreateCa(ctx *middleware.Context, handler CreateCaHandler) *CreateCa { return &CreateCa{Context: ctx, Handler: handler} } -/*CreateCa swagger:route POST /cas Certificate Authority createCa +/* CreateCa swagger:route POST /cas Certificate Authority createCa Creates a CA @@ -68,21 +68,20 @@ type CreateCa struct { func (o *CreateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/create_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/create_ca_parameters.go similarity index 91% rename from rest_server/operations/certificate_authority/create_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/create_ca_parameters.go index 0a060b997..eec3a841f 100644 --- a/rest_server/operations/certificate_authority/create_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/create_ca_parameters.go @@ -30,18 +30,21 @@ package certificate_authority // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateCaParams() CreateCaParams { return CreateCaParams{} @@ -87,6 +90,11 @@ func (o *CreateCaParams) BindRequest(r *http.Request, route *middleware.MatchedR 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 } diff --git a/rest_server/operations/certificate_authority/create_ca_responses.go b/rest_management_api_server/operations/certificate_authority/create_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/create_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/create_ca_responses.go diff --git a/rest_server/operations/certificate_authority/create_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/create_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go index af0313394..d8980ce2c 100644 --- a/rest_server/operations/certificate_authority/create_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/delete_ca.go b/rest_management_api_server/operations/certificate_authority/delete_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/delete_ca.go rename to rest_management_api_server/operations/certificate_authority/delete_ca.go index 1d67875f7..bb257062a 100644 --- a/rest_server/operations/certificate_authority/delete_ca.go +++ b/rest_management_api_server/operations/certificate_authority/delete_ca.go @@ -53,7 +53,7 @@ func NewDeleteCa(ctx *middleware.Context, handler DeleteCaHandler) *DeleteCa { return &DeleteCa{Context: ctx, Handler: handler} } -/*DeleteCa swagger:route DELETE /cas/{id} Certificate Authority deleteCa +/* DeleteCa swagger:route DELETE /cas/{id} Certificate Authority deleteCa Delete a CA @@ -70,21 +70,20 @@ type DeleteCa struct { func (o *DeleteCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *DeleteCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/delete_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go similarity index 98% rename from rest_server/operations/certificate_authority/delete_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go index 7aac22b2b..68a916f29 100644 --- a/rest_server/operations/certificate_authority/delete_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteCaParams creates a new DeleteCaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteCaParams() DeleteCaParams { return DeleteCaParams{} @@ -73,7 +74,6 @@ func (o *DeleteCaParams) BindRequest(r *http.Request, route *middleware.MatchedR if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Re // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/delete_ca_responses.go b/rest_management_api_server/operations/certificate_authority/delete_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/delete_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/delete_ca_responses.go diff --git a/rest_server/operations/certificate_authority/delete_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/delete_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go index 40570172a..7bb0fa417 100644 --- a/rest_server/operations/certificate_authority/delete_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/detail_ca.go b/rest_management_api_server/operations/certificate_authority/detail_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/detail_ca.go rename to rest_management_api_server/operations/certificate_authority/detail_ca.go index 09d083aac..4ab400ebc 100644 --- a/rest_server/operations/certificate_authority/detail_ca.go +++ b/rest_management_api_server/operations/certificate_authority/detail_ca.go @@ -53,7 +53,7 @@ func NewDetailCa(ctx *middleware.Context, handler DetailCaHandler) *DetailCa { return &DetailCa{Context: ctx, Handler: handler} } -/*DetailCa swagger:route GET /cas/{id} Certificate Authority detailCa +/* DetailCa swagger:route GET /cas/{id} Certificate Authority detailCa Retrieves a single CA @@ -68,21 +68,20 @@ type DetailCa struct { func (o *DetailCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/detail_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go similarity index 98% rename from rest_server/operations/certificate_authority/detail_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go index ec4e3915d..477c140f9 100644 --- a/rest_server/operations/certificate_authority/detail_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailCaParams creates a new DetailCaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailCaParams() DetailCaParams { return DetailCaParams{} @@ -73,7 +74,6 @@ func (o *DetailCaParams) BindRequest(r *http.Request, route *middleware.MatchedR if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Re // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/detail_ca_responses.go b/rest_management_api_server/operations/certificate_authority/detail_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/detail_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/detail_ca_responses.go diff --git a/rest_server/operations/certificate_authority/detail_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/detail_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go index 40575a17f..c4911c228 100644 --- a/rest_server/operations/certificate_authority/detail_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/get_ca_jwt.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt.go similarity index 94% rename from rest_server/operations/certificate_authority/get_ca_jwt.go rename to rest_management_api_server/operations/certificate_authority/get_ca_jwt.go index 944210474..0bf0b26fb 100644 --- a/rest_server/operations/certificate_authority/get_ca_jwt.go +++ b/rest_management_api_server/operations/certificate_authority/get_ca_jwt.go @@ -53,7 +53,7 @@ func NewGetCaJwt(ctx *middleware.Context, handler GetCaJwtHandler) *GetCaJwt { return &GetCaJwt{Context: ctx, Handler: handler} } -/*GetCaJwt swagger:route GET /cas/{id}/jwt Certificate Authority getCaJwt +/* GetCaJwt swagger:route GET /cas/{id}/jwt Certificate Authority getCaJwt Retrieve the enrollment JWT for a CA @@ -70,21 +70,20 @@ type GetCaJwt struct { func (o *GetCaJwt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *GetCaJwt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/get_ca_jwt_parameters.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go similarity index 98% rename from rest_server/operations/certificate_authority/get_ca_jwt_parameters.go rename to rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go index 722b47837..a2c3b3485 100644 --- a/rest_server/operations/certificate_authority/get_ca_jwt_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewGetCaJwtParams creates a new GetCaJwtParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetCaJwtParams() GetCaJwtParams { return GetCaJwtParams{} @@ -73,7 +74,6 @@ func (o *GetCaJwtParams) BindRequest(r *http.Request, route *middleware.MatchedR if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *GetCaJwtParams) bindID(rawData []string, hasKey bool, formats strfmt.Re // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/get_ca_jwt_responses.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/get_ca_jwt_responses.go rename to rest_management_api_server/operations/certificate_authority/get_ca_jwt_responses.go diff --git a/rest_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go index 3ef00136a..2ea4bcfa6 100644 --- a/rest_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go @@ -75,7 +75,7 @@ func (o *GetCaJwtURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/list_cas.go b/rest_management_api_server/operations/certificate_authority/list_cas.go similarity index 94% rename from rest_server/operations/certificate_authority/list_cas.go rename to rest_management_api_server/operations/certificate_authority/list_cas.go index 5b067c79d..7e0108484 100644 --- a/rest_server/operations/certificate_authority/list_cas.go +++ b/rest_management_api_server/operations/certificate_authority/list_cas.go @@ -53,7 +53,7 @@ func NewListCas(ctx *middleware.Context, handler ListCasHandler) *ListCas { return &ListCas{Context: ctx, Handler: handler} } -/*ListCas swagger:route GET /cas Certificate Authority listCas +/* ListCas swagger:route GET /cas Certificate Authority listCas List CAs @@ -68,21 +68,20 @@ type ListCas struct { func (o *ListCas) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListCas) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/list_cas_parameters.go b/rest_management_api_server/operations/certificate_authority/list_cas_parameters.go similarity index 98% rename from rest_server/operations/certificate_authority/list_cas_parameters.go rename to rest_management_api_server/operations/certificate_authority/list_cas_parameters.go index effaaafda..6920ad72d 100644 --- a/rest_server/operations/certificate_authority/list_cas_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/list_cas_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListCasParams creates a new ListCasParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListCasParams() ListCasParams { return ListCasParams{} @@ -94,7 +95,6 @@ func (o *ListCasParams) BindRequest(r *http.Request, route *middleware.MatchedRo if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListCasParams) bindFilter(rawData []string, hasKey bool, formats strfmt // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListCasParams) bindLimit(rawData []string, hasKey bool, formats strfmt. // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListCasParams) bindOffset(rawData []string, hasKey bool, formats strfmt // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/certificate_authority/list_cas_responses.go b/rest_management_api_server/operations/certificate_authority/list_cas_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/list_cas_responses.go rename to rest_management_api_server/operations/certificate_authority/list_cas_responses.go diff --git a/rest_server/operations/certificate_authority/list_cas_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go similarity index 99% rename from rest_server/operations/certificate_authority/list_cas_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go index cfc4b0ed4..1f6288098 100644 --- a/rest_server/operations/certificate_authority/list_cas_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListCasURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/patch_ca.go b/rest_management_api_server/operations/certificate_authority/patch_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/patch_ca.go rename to rest_management_api_server/operations/certificate_authority/patch_ca.go index 95a546045..4f027c5c0 100644 --- a/rest_server/operations/certificate_authority/patch_ca.go +++ b/rest_management_api_server/operations/certificate_authority/patch_ca.go @@ -53,7 +53,7 @@ func NewPatchCa(ctx *middleware.Context, handler PatchCaHandler) *PatchCa { return &PatchCa{Context: ctx, Handler: handler} } -/*PatchCa swagger:route PATCH /cas/{id} Certificate Authority patchCa +/* PatchCa swagger:route PATCH /cas/{id} Certificate Authority patchCa Update the supplied fields on a CA @@ -68,21 +68,20 @@ type PatchCa struct { func (o *PatchCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/patch_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go similarity index 92% rename from rest_server/operations/certificate_authority/patch_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go index dd0c7131f..dd3b72825 100644 --- a/rest_server/operations/certificate_authority/patch_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go @@ -30,6 +30,7 @@ package certificate_authority // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchCaParams() PatchCaParams { return PatchCaParams{} @@ -93,6 +96,11 @@ func (o *PatchCaParams) BindRequest(r *http.Request, route *middleware.MatchedRo 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 } @@ -100,11 +108,11 @@ func (o *PatchCaParams) BindRequest(r *http.Request, route *middleware.MatchedRo } 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...) } @@ -120,7 +128,6 @@ func (o *PatchCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Reg // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/patch_ca_responses.go b/rest_management_api_server/operations/certificate_authority/patch_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/patch_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/patch_ca_responses.go diff --git a/rest_server/operations/certificate_authority/patch_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/patch_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go index 7cf8d4626..549d38814 100644 --- a/rest_server/operations/certificate_authority/patch_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/update_ca.go b/rest_management_api_server/operations/certificate_authority/update_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/update_ca.go rename to rest_management_api_server/operations/certificate_authority/update_ca.go index c6e10e102..06f7a0acf 100644 --- a/rest_server/operations/certificate_authority/update_ca.go +++ b/rest_management_api_server/operations/certificate_authority/update_ca.go @@ -53,7 +53,7 @@ func NewUpdateCa(ctx *middleware.Context, handler UpdateCaHandler) *UpdateCa { return &UpdateCa{Context: ctx, Handler: handler} } -/*UpdateCa swagger:route PUT /cas/{id} Certificate Authority updateCa +/* UpdateCa swagger:route PUT /cas/{id} Certificate Authority updateCa Update all fields on a CA @@ -68,21 +68,20 @@ type UpdateCa struct { func (o *UpdateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/update_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/update_ca_parameters.go similarity index 92% rename from rest_server/operations/certificate_authority/update_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/update_ca_parameters.go index 064e63f1f..8c470ef21 100644 --- a/rest_server/operations/certificate_authority/update_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/update_ca_parameters.go @@ -30,6 +30,7 @@ package certificate_authority // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateCaParams() UpdateCaParams { return UpdateCaParams{} @@ -93,6 +96,11 @@ func (o *UpdateCaParams) BindRequest(r *http.Request, route *middleware.MatchedR 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 } @@ -100,11 +108,11 @@ func (o *UpdateCaParams) BindRequest(r *http.Request, route *middleware.MatchedR } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Re // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/update_ca_responses.go b/rest_management_api_server/operations/certificate_authority/update_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/update_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/update_ca_responses.go diff --git a/rest_server/operations/certificate_authority/update_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/update_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go index 426ad90d3..7b7296695 100644 --- a/rest_server/operations/certificate_authority/update_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/certificate_authority/verify_ca.go b/rest_management_api_server/operations/certificate_authority/verify_ca.go similarity index 94% rename from rest_server/operations/certificate_authority/verify_ca.go rename to rest_management_api_server/operations/certificate_authority/verify_ca.go index 7bc242a31..5229a78dc 100644 --- a/rest_server/operations/certificate_authority/verify_ca.go +++ b/rest_management_api_server/operations/certificate_authority/verify_ca.go @@ -53,7 +53,7 @@ func NewVerifyCa(ctx *middleware.Context, handler VerifyCaHandler) *VerifyCa { return &VerifyCa{Context: ctx, Handler: handler} } -/*VerifyCa swagger:route POST /cas/{id}/verify Certificate Authority verifyCa +/* VerifyCa swagger:route POST /cas/{id}/verify Certificate Authority verifyCa Verify a CA @@ -71,21 +71,20 @@ type VerifyCa struct { func (o *VerifyCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -94,7 +93,6 @@ func (o *VerifyCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/certificate_authority/verify_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go similarity index 98% rename from rest_server/operations/certificate_authority/verify_ca_parameters.go rename to rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go index c2af7c88a..e4d388bca 100644 --- a/rest_server/operations/certificate_authority/verify_ca_parameters.go +++ b/rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewVerifyCaParams creates a new VerifyCaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewVerifyCaParams() VerifyCaParams { return VerifyCaParams{} @@ -92,11 +93,11 @@ func (o *VerifyCaParams) BindRequest(r *http.Request, route *middleware.MatchedR } 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...) } @@ -112,7 +113,6 @@ func (o *VerifyCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Re // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/certificate_authority/verify_ca_responses.go b/rest_management_api_server/operations/certificate_authority/verify_ca_responses.go similarity index 100% rename from rest_server/operations/certificate_authority/verify_ca_responses.go rename to rest_management_api_server/operations/certificate_authority/verify_ca_responses.go diff --git a/rest_server/operations/certificate_authority/verify_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go similarity index 98% rename from rest_server/operations/certificate_authority/verify_ca_urlbuilder.go rename to rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go index 8b96d58b3..46c9ebd62 100644 --- a/rest_server/operations/certificate_authority/verify_ca_urlbuilder.go +++ b/rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go @@ -75,7 +75,7 @@ func (o *VerifyCaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/create_config.go b/rest_management_api_server/operations/config/create_config.go similarity index 94% rename from rest_server/operations/config/create_config.go rename to rest_management_api_server/operations/config/create_config.go index 3fc121ceb..7d0d35bc0 100644 --- a/rest_server/operations/config/create_config.go +++ b/rest_management_api_server/operations/config/create_config.go @@ -53,7 +53,7 @@ func NewCreateConfig(ctx *middleware.Context, handler CreateConfigHandler) *Crea return &CreateConfig{Context: ctx, Handler: handler} } -/*CreateConfig swagger:route POST /configs Config createConfig +/* CreateConfig swagger:route POST /configs Config createConfig Create a config resource @@ -68,21 +68,20 @@ type CreateConfig struct { func (o *CreateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/create_config_parameters.go b/rest_management_api_server/operations/config/create_config_parameters.go similarity index 91% rename from rest_server/operations/config/create_config_parameters.go rename to rest_management_api_server/operations/config/create_config_parameters.go index b58f9c36d..926969d97 100644 --- a/rest_server/operations/config/create_config_parameters.go +++ b/rest_management_api_server/operations/config/create_config_parameters.go @@ -30,18 +30,21 @@ package config // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateConfigParams() CreateConfigParams { return CreateConfigParams{} @@ -87,6 +90,11 @@ func (o *CreateConfigParams) BindRequest(r *http.Request, route *middleware.Matc 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 } diff --git a/rest_server/operations/config/create_config_responses.go b/rest_management_api_server/operations/config/create_config_responses.go similarity index 100% rename from rest_server/operations/config/create_config_responses.go rename to rest_management_api_server/operations/config/create_config_responses.go diff --git a/rest_server/operations/config/create_config_type.go b/rest_management_api_server/operations/config/create_config_type.go similarity index 94% rename from rest_server/operations/config/create_config_type.go rename to rest_management_api_server/operations/config/create_config_type.go index 2b33ac37e..14d566787 100644 --- a/rest_server/operations/config/create_config_type.go +++ b/rest_management_api_server/operations/config/create_config_type.go @@ -53,7 +53,7 @@ func NewCreateConfigType(ctx *middleware.Context, handler CreateConfigTypeHandle return &CreateConfigType{Context: ctx, Handler: handler} } -/*CreateConfigType swagger:route POST /config-types Config createConfigType +/* CreateConfigType swagger:route POST /config-types Config createConfigType Create a config-type. Requires admin access. @@ -66,21 +66,20 @@ type CreateConfigType struct { func (o *CreateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -89,7 +88,6 @@ func (o *CreateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/create_config_type_parameters.go b/rest_management_api_server/operations/config/create_config_type_parameters.go similarity index 92% rename from rest_server/operations/config/create_config_type_parameters.go rename to rest_management_api_server/operations/config/create_config_type_parameters.go index b376bb17e..90e612aa3 100644 --- a/rest_server/operations/config/create_config_type_parameters.go +++ b/rest_management_api_server/operations/config/create_config_type_parameters.go @@ -30,18 +30,21 @@ package config // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateConfigTypeParams() CreateConfigTypeParams { return CreateConfigTypeParams{} @@ -87,6 +90,11 @@ func (o *CreateConfigTypeParams) BindRequest(r *http.Request, route *middleware. 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 } diff --git a/rest_server/operations/config/create_config_type_responses.go b/rest_management_api_server/operations/config/create_config_type_responses.go similarity index 100% rename from rest_server/operations/config/create_config_type_responses.go rename to rest_management_api_server/operations/config/create_config_type_responses.go diff --git a/rest_server/operations/config/create_config_type_urlbuilder.go b/rest_management_api_server/operations/config/create_config_type_urlbuilder.go similarity index 98% rename from rest_server/operations/config/create_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/create_config_type_urlbuilder.go index 93735f7c4..93e28212e 100644 --- a/rest_server/operations/config/create_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/create_config_type_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/create_config_urlbuilder.go b/rest_management_api_server/operations/config/create_config_urlbuilder.go similarity index 98% rename from rest_server/operations/config/create_config_urlbuilder.go rename to rest_management_api_server/operations/config/create_config_urlbuilder.go index 860f7fd24..f829e65d5 100644 --- a/rest_server/operations/config/create_config_urlbuilder.go +++ b/rest_management_api_server/operations/config/create_config_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/delete_config.go b/rest_management_api_server/operations/config/delete_config.go similarity index 94% rename from rest_server/operations/config/delete_config.go rename to rest_management_api_server/operations/config/delete_config.go index 281ffb8cc..0b22805c1 100644 --- a/rest_server/operations/config/delete_config.go +++ b/rest_management_api_server/operations/config/delete_config.go @@ -53,7 +53,7 @@ func NewDeleteConfig(ctx *middleware.Context, handler DeleteConfigHandler) *Dele return &DeleteConfig{Context: ctx, Handler: handler} } -/*DeleteConfig swagger:route DELETE /configs/{id} Config deleteConfig +/* DeleteConfig swagger:route DELETE /configs/{id} Config deleteConfig Delete a config @@ -68,21 +68,20 @@ type DeleteConfig struct { func (o *DeleteConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/delete_config_parameters.go b/rest_management_api_server/operations/config/delete_config_parameters.go similarity index 98% rename from rest_server/operations/config/delete_config_parameters.go rename to rest_management_api_server/operations/config/delete_config_parameters.go index 92528bd0c..8f6a8950c 100644 --- a/rest_server/operations/config/delete_config_parameters.go +++ b/rest_management_api_server/operations/config/delete_config_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteConfigParams creates a new DeleteConfigParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteConfigParams() DeleteConfigParams { return DeleteConfigParams{} @@ -73,7 +74,6 @@ func (o *DeleteConfigParams) BindRequest(r *http.Request, route *middleware.Matc if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteConfigParams) bindID(rawData []string, hasKey bool, formats strfm // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/delete_config_responses.go b/rest_management_api_server/operations/config/delete_config_responses.go similarity index 100% rename from rest_server/operations/config/delete_config_responses.go rename to rest_management_api_server/operations/config/delete_config_responses.go diff --git a/rest_server/operations/config/delete_config_type.go b/rest_management_api_server/operations/config/delete_config_type.go similarity index 94% rename from rest_server/operations/config/delete_config_type.go rename to rest_management_api_server/operations/config/delete_config_type.go index c86ccebe6..fe6d0d1e7 100644 --- a/rest_server/operations/config/delete_config_type.go +++ b/rest_management_api_server/operations/config/delete_config_type.go @@ -53,7 +53,7 @@ func NewDeleteConfigType(ctx *middleware.Context, handler DeleteConfigTypeHandle return &DeleteConfigType{Context: ctx, Handler: handler} } -/*DeleteConfigType swagger:route DELETE /config-types/{id} Config deleteConfigType +/* DeleteConfigType swagger:route DELETE /config-types/{id} Config deleteConfigType Delete a config-type @@ -68,21 +68,20 @@ type DeleteConfigType struct { func (o *DeleteConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/delete_config_type_parameters.go b/rest_management_api_server/operations/config/delete_config_type_parameters.go similarity index 98% rename from rest_server/operations/config/delete_config_type_parameters.go rename to rest_management_api_server/operations/config/delete_config_type_parameters.go index affa38de6..ac430fcc5 100644 --- a/rest_server/operations/config/delete_config_type_parameters.go +++ b/rest_management_api_server/operations/config/delete_config_type_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteConfigTypeParams creates a new DeleteConfigTypeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteConfigTypeParams() DeleteConfigTypeParams { return DeleteConfigTypeParams{} @@ -73,7 +74,6 @@ func (o *DeleteConfigTypeParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteConfigTypeParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/delete_config_type_responses.go b/rest_management_api_server/operations/config/delete_config_type_responses.go similarity index 100% rename from rest_server/operations/config/delete_config_type_responses.go rename to rest_management_api_server/operations/config/delete_config_type_responses.go diff --git a/rest_server/operations/config/delete_config_type_urlbuilder.go b/rest_management_api_server/operations/config/delete_config_type_urlbuilder.go similarity index 98% rename from rest_server/operations/config/delete_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/delete_config_type_urlbuilder.go index 66bb00f33..2ed890751 100644 --- a/rest_server/operations/config/delete_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/delete_config_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/delete_config_urlbuilder.go b/rest_management_api_server/operations/config/delete_config_urlbuilder.go similarity index 98% rename from rest_server/operations/config/delete_config_urlbuilder.go rename to rest_management_api_server/operations/config/delete_config_urlbuilder.go index 76c60eb84..a7fe99e94 100644 --- a/rest_server/operations/config/delete_config_urlbuilder.go +++ b/rest_management_api_server/operations/config/delete_config_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/detail_config.go b/rest_management_api_server/operations/config/detail_config.go similarity index 94% rename from rest_server/operations/config/detail_config.go rename to rest_management_api_server/operations/config/detail_config.go index b09143373..fcbcef254 100644 --- a/rest_server/operations/config/detail_config.go +++ b/rest_management_api_server/operations/config/detail_config.go @@ -53,7 +53,7 @@ func NewDetailConfig(ctx *middleware.Context, handler DetailConfigHandler) *Deta return &DetailConfig{Context: ctx, Handler: handler} } -/*DetailConfig swagger:route GET /configs/{id} Config detailConfig +/* DetailConfig swagger:route GET /configs/{id} Config detailConfig Retrieves a single config @@ -68,21 +68,20 @@ type DetailConfig struct { func (o *DetailConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/detail_config_parameters.go b/rest_management_api_server/operations/config/detail_config_parameters.go similarity index 98% rename from rest_server/operations/config/detail_config_parameters.go rename to rest_management_api_server/operations/config/detail_config_parameters.go index cc54f2744..10bed3139 100644 --- a/rest_server/operations/config/detail_config_parameters.go +++ b/rest_management_api_server/operations/config/detail_config_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailConfigParams creates a new DetailConfigParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailConfigParams() DetailConfigParams { return DetailConfigParams{} @@ -73,7 +74,6 @@ func (o *DetailConfigParams) BindRequest(r *http.Request, route *middleware.Matc if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailConfigParams) bindID(rawData []string, hasKey bool, formats strfm // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/detail_config_responses.go b/rest_management_api_server/operations/config/detail_config_responses.go similarity index 100% rename from rest_server/operations/config/detail_config_responses.go rename to rest_management_api_server/operations/config/detail_config_responses.go diff --git a/rest_server/operations/config/detail_config_type.go b/rest_management_api_server/operations/config/detail_config_type.go similarity index 94% rename from rest_server/operations/config/detail_config_type.go rename to rest_management_api_server/operations/config/detail_config_type.go index e8334d0df..627bc529f 100644 --- a/rest_server/operations/config/detail_config_type.go +++ b/rest_management_api_server/operations/config/detail_config_type.go @@ -53,7 +53,7 @@ func NewDetailConfigType(ctx *middleware.Context, handler DetailConfigTypeHandle return &DetailConfigType{Context: ctx, Handler: handler} } -/*DetailConfigType swagger:route GET /config-types/{id} Config detailConfigType +/* DetailConfigType swagger:route GET /config-types/{id} Config detailConfigType Retrieves a single config-type @@ -68,21 +68,20 @@ type DetailConfigType struct { func (o *DetailConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/detail_config_type_parameters.go b/rest_management_api_server/operations/config/detail_config_type_parameters.go similarity index 98% rename from rest_server/operations/config/detail_config_type_parameters.go rename to rest_management_api_server/operations/config/detail_config_type_parameters.go index 14d72a96a..41d998777 100644 --- a/rest_server/operations/config/detail_config_type_parameters.go +++ b/rest_management_api_server/operations/config/detail_config_type_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailConfigTypeParams creates a new DetailConfigTypeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailConfigTypeParams() DetailConfigTypeParams { return DetailConfigTypeParams{} @@ -73,7 +74,6 @@ func (o *DetailConfigTypeParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailConfigTypeParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/detail_config_type_responses.go b/rest_management_api_server/operations/config/detail_config_type_responses.go similarity index 100% rename from rest_server/operations/config/detail_config_type_responses.go rename to rest_management_api_server/operations/config/detail_config_type_responses.go diff --git a/rest_server/operations/config/detail_config_type_urlbuilder.go b/rest_management_api_server/operations/config/detail_config_type_urlbuilder.go similarity index 98% rename from rest_server/operations/config/detail_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/detail_config_type_urlbuilder.go index 1579a7c27..b046933ed 100644 --- a/rest_server/operations/config/detail_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/detail_config_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/detail_config_urlbuilder.go b/rest_management_api_server/operations/config/detail_config_urlbuilder.go similarity index 98% rename from rest_server/operations/config/detail_config_urlbuilder.go rename to rest_management_api_server/operations/config/detail_config_urlbuilder.go index 7646e30bb..594b18abe 100644 --- a/rest_server/operations/config/detail_config_urlbuilder.go +++ b/rest_management_api_server/operations/config/detail_config_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/list_config_types.go b/rest_management_api_server/operations/config/list_config_types.go similarity index 94% rename from rest_server/operations/config/list_config_types.go rename to rest_management_api_server/operations/config/list_config_types.go index 9ab5cd886..4b1bdedd9 100644 --- a/rest_server/operations/config/list_config_types.go +++ b/rest_management_api_server/operations/config/list_config_types.go @@ -53,7 +53,7 @@ func NewListConfigTypes(ctx *middleware.Context, handler ListConfigTypesHandler) return &ListConfigTypes{Context: ctx, Handler: handler} } -/*ListConfigTypes swagger:route GET /config-types Config listConfigTypes +/* ListConfigTypes swagger:route GET /config-types Config listConfigTypes List config-types @@ -69,21 +69,20 @@ type ListConfigTypes struct { func (o *ListConfigTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListConfigTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/list_config_types_parameters.go b/rest_management_api_server/operations/config/list_config_types_parameters.go similarity index 98% rename from rest_server/operations/config/list_config_types_parameters.go rename to rest_management_api_server/operations/config/list_config_types_parameters.go index e5fc09842..560e1d1f6 100644 --- a/rest_server/operations/config/list_config_types_parameters.go +++ b/rest_management_api_server/operations/config/list_config_types_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListConfigTypesParams creates a new ListConfigTypesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListConfigTypesParams() ListConfigTypesParams { return ListConfigTypesParams{} @@ -94,7 +95,6 @@ func (o *ListConfigTypesParams) BindRequest(r *http.Request, route *middleware.M if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListConfigTypesParams) bindFilter(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListConfigTypesParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListConfigTypesParams) bindOffset(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/config/list_config_types_responses.go b/rest_management_api_server/operations/config/list_config_types_responses.go similarity index 100% rename from rest_server/operations/config/list_config_types_responses.go rename to rest_management_api_server/operations/config/list_config_types_responses.go diff --git a/rest_server/operations/config/list_config_types_urlbuilder.go b/rest_management_api_server/operations/config/list_config_types_urlbuilder.go similarity index 99% rename from rest_server/operations/config/list_config_types_urlbuilder.go rename to rest_management_api_server/operations/config/list_config_types_urlbuilder.go index 521056cb8..afeac3610 100644 --- a/rest_server/operations/config/list_config_types_urlbuilder.go +++ b/rest_management_api_server/operations/config/list_config_types_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListConfigTypesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/list_configs.go b/rest_management_api_server/operations/config/list_configs.go similarity index 94% rename from rest_server/operations/config/list_configs.go rename to rest_management_api_server/operations/config/list_configs.go index 198133955..d299e9f4f 100644 --- a/rest_server/operations/config/list_configs.go +++ b/rest_management_api_server/operations/config/list_configs.go @@ -53,7 +53,7 @@ func NewListConfigs(ctx *middleware.Context, handler ListConfigsHandler) *ListCo return &ListConfigs{Context: ctx, Handler: handler} } -/*ListConfigs swagger:route GET /configs Config listConfigs +/* ListConfigs swagger:route GET /configs Config listConfigs List configs @@ -69,21 +69,20 @@ type ListConfigs struct { func (o *ListConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/list_configs_for_config_type.go b/rest_management_api_server/operations/config/list_configs_for_config_type.go similarity index 93% rename from rest_server/operations/config/list_configs_for_config_type.go rename to rest_management_api_server/operations/config/list_configs_for_config_type.go index f185e1919..24996308a 100644 --- a/rest_server/operations/config/list_configs_for_config_type.go +++ b/rest_management_api_server/operations/config/list_configs_for_config_type.go @@ -53,7 +53,7 @@ func NewListConfigsForConfigType(ctx *middleware.Context, handler ListConfigsFor return &ListConfigsForConfigType{Context: ctx, Handler: handler} } -/*ListConfigsForConfigType swagger:route GET /config-types/{id}/configs Config listConfigsForConfigType +/* ListConfigsForConfigType swagger:route GET /config-types/{id}/configs Config listConfigsForConfigType Lists the configs of a specific config-type @@ -68,21 +68,20 @@ type ListConfigsForConfigType struct { func (o *ListConfigsForConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListConfigsForConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Req } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/list_configs_for_config_type_parameters.go b/rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go similarity index 98% rename from rest_server/operations/config/list_configs_for_config_type_parameters.go rename to rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go index 17de3b054..5416e452b 100644 --- a/rest_server/operations/config/list_configs_for_config_type_parameters.go +++ b/rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListConfigsForConfigTypeParams creates a new ListConfigsForConfigTypeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListConfigsForConfigTypeParams() ListConfigsForConfigTypeParams { return ListConfigsForConfigTypeParams{} @@ -73,7 +74,6 @@ func (o *ListConfigsForConfigTypeParams) BindRequest(r *http.Request, route *mid if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListConfigsForConfigTypeParams) bindID(rawData []string, hasKey bool, f // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/list_configs_for_config_type_responses.go b/rest_management_api_server/operations/config/list_configs_for_config_type_responses.go similarity index 100% rename from rest_server/operations/config/list_configs_for_config_type_responses.go rename to rest_management_api_server/operations/config/list_configs_for_config_type_responses.go diff --git a/rest_server/operations/config/list_configs_for_config_type_urlbuilder.go b/rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go similarity index 99% rename from rest_server/operations/config/list_configs_for_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go index e506ba8a5..fec96b718 100644 --- a/rest_server/operations/config/list_configs_for_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListConfigsForConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/list_configs_parameters.go b/rest_management_api_server/operations/config/list_configs_parameters.go similarity index 98% rename from rest_server/operations/config/list_configs_parameters.go rename to rest_management_api_server/operations/config/list_configs_parameters.go index 01483f4a3..87d184225 100644 --- a/rest_server/operations/config/list_configs_parameters.go +++ b/rest_management_api_server/operations/config/list_configs_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListConfigsParams creates a new ListConfigsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListConfigsParams() ListConfigsParams { return ListConfigsParams{} @@ -94,7 +95,6 @@ func (o *ListConfigsParams) BindRequest(r *http.Request, route *middleware.Match if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListConfigsParams) bindFilter(rawData []string, hasKey bool, formats st // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListConfigsParams) bindLimit(rawData []string, hasKey bool, formats str // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListConfigsParams) bindOffset(rawData []string, hasKey bool, formats st // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/config/list_configs_responses.go b/rest_management_api_server/operations/config/list_configs_responses.go similarity index 100% rename from rest_server/operations/config/list_configs_responses.go rename to rest_management_api_server/operations/config/list_configs_responses.go diff --git a/rest_server/operations/config/list_configs_urlbuilder.go b/rest_management_api_server/operations/config/list_configs_urlbuilder.go similarity index 99% rename from rest_server/operations/config/list_configs_urlbuilder.go rename to rest_management_api_server/operations/config/list_configs_urlbuilder.go index 15cd4ad27..fb4464493 100644 --- a/rest_server/operations/config/list_configs_urlbuilder.go +++ b/rest_management_api_server/operations/config/list_configs_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListConfigsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/patch_config.go b/rest_management_api_server/operations/config/patch_config.go similarity index 94% rename from rest_server/operations/config/patch_config.go rename to rest_management_api_server/operations/config/patch_config.go index ebe6f30e6..33449c28d 100644 --- a/rest_server/operations/config/patch_config.go +++ b/rest_management_api_server/operations/config/patch_config.go @@ -53,7 +53,7 @@ func NewPatchConfig(ctx *middleware.Context, handler PatchConfigHandler) *PatchC return &PatchConfig{Context: ctx, Handler: handler} } -/*PatchConfig swagger:route PATCH /configs/{id} Config patchConfig +/* PatchConfig swagger:route PATCH /configs/{id} Config patchConfig Update the supplied fields on a config @@ -68,21 +68,20 @@ type PatchConfig struct { func (o *PatchConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/patch_config_parameters.go b/rest_management_api_server/operations/config/patch_config_parameters.go similarity index 93% rename from rest_server/operations/config/patch_config_parameters.go rename to rest_management_api_server/operations/config/patch_config_parameters.go index ba7d5ee55..e31d87bd0 100644 --- a/rest_server/operations/config/patch_config_parameters.go +++ b/rest_management_api_server/operations/config/patch_config_parameters.go @@ -30,6 +30,7 @@ package config // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchConfigParams() PatchConfigParams { return PatchConfigParams{} @@ -93,6 +96,11 @@ func (o *PatchConfigParams) BindRequest(r *http.Request, route *middleware.Match 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 } @@ -100,11 +108,11 @@ func (o *PatchConfigParams) BindRequest(r *http.Request, route *middleware.Match } 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...) } @@ -120,7 +128,6 @@ func (o *PatchConfigParams) bindID(rawData []string, hasKey bool, formats strfmt // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/patch_config_responses.go b/rest_management_api_server/operations/config/patch_config_responses.go similarity index 100% rename from rest_server/operations/config/patch_config_responses.go rename to rest_management_api_server/operations/config/patch_config_responses.go diff --git a/rest_server/operations/config/patch_config_type.go b/rest_management_api_server/operations/config/patch_config_type.go similarity index 94% rename from rest_server/operations/config/patch_config_type.go rename to rest_management_api_server/operations/config/patch_config_type.go index 368d87c6f..6c4b45315 100644 --- a/rest_server/operations/config/patch_config_type.go +++ b/rest_management_api_server/operations/config/patch_config_type.go @@ -53,7 +53,7 @@ func NewPatchConfigType(ctx *middleware.Context, handler PatchConfigTypeHandler) return &PatchConfigType{Context: ctx, Handler: handler} } -/*PatchConfigType swagger:route PATCH /config-types/{id} Config patchConfigType +/* PatchConfigType swagger:route PATCH /config-types/{id} Config patchConfigType Update the supplied fields on a config-type @@ -68,21 +68,20 @@ type PatchConfigType struct { func (o *PatchConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/patch_config_type_parameters.go b/rest_management_api_server/operations/config/patch_config_type_parameters.go similarity index 93% rename from rest_server/operations/config/patch_config_type_parameters.go rename to rest_management_api_server/operations/config/patch_config_type_parameters.go index b47ddb298..0edc7f881 100644 --- a/rest_server/operations/config/patch_config_type_parameters.go +++ b/rest_management_api_server/operations/config/patch_config_type_parameters.go @@ -30,6 +30,7 @@ package config // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchConfigTypeParams() PatchConfigTypeParams { return PatchConfigTypeParams{} @@ -93,6 +96,11 @@ func (o *PatchConfigTypeParams) BindRequest(r *http.Request, route *middleware.M 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 } @@ -100,11 +108,11 @@ func (o *PatchConfigTypeParams) BindRequest(r *http.Request, route *middleware.M } 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...) } @@ -120,7 +128,6 @@ func (o *PatchConfigTypeParams) bindID(rawData []string, hasKey bool, formats st // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/patch_config_type_responses.go b/rest_management_api_server/operations/config/patch_config_type_responses.go similarity index 100% rename from rest_server/operations/config/patch_config_type_responses.go rename to rest_management_api_server/operations/config/patch_config_type_responses.go diff --git a/rest_server/operations/config/patch_config_type_urlbuilder.go b/rest_management_api_server/operations/config/patch_config_type_urlbuilder.go similarity index 98% rename from rest_server/operations/config/patch_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/patch_config_type_urlbuilder.go index f0f16d5df..28699ee8e 100644 --- a/rest_server/operations/config/patch_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/patch_config_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/patch_config_urlbuilder.go b/rest_management_api_server/operations/config/patch_config_urlbuilder.go similarity index 98% rename from rest_server/operations/config/patch_config_urlbuilder.go rename to rest_management_api_server/operations/config/patch_config_urlbuilder.go index 89ddc52b8..54022f01c 100644 --- a/rest_server/operations/config/patch_config_urlbuilder.go +++ b/rest_management_api_server/operations/config/patch_config_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/update_config.go b/rest_management_api_server/operations/config/update_config.go similarity index 94% rename from rest_server/operations/config/update_config.go rename to rest_management_api_server/operations/config/update_config.go index 4098b0be6..e2e64b200 100644 --- a/rest_server/operations/config/update_config.go +++ b/rest_management_api_server/operations/config/update_config.go @@ -53,7 +53,7 @@ func NewUpdateConfig(ctx *middleware.Context, handler UpdateConfigHandler) *Upda return &UpdateConfig{Context: ctx, Handler: handler} } -/*UpdateConfig swagger:route PUT /configs/{id} Config updateConfig +/* UpdateConfig swagger:route PUT /configs/{id} Config updateConfig Update all fields on a config @@ -68,21 +68,20 @@ type UpdateConfig struct { func (o *UpdateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/update_config_parameters.go b/rest_management_api_server/operations/config/update_config_parameters.go similarity index 93% rename from rest_server/operations/config/update_config_parameters.go rename to rest_management_api_server/operations/config/update_config_parameters.go index a6cc2fb63..e1d83474f 100644 --- a/rest_server/operations/config/update_config_parameters.go +++ b/rest_management_api_server/operations/config/update_config_parameters.go @@ -30,6 +30,7 @@ package config // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateConfigParams() UpdateConfigParams { return UpdateConfigParams{} @@ -93,6 +96,11 @@ func (o *UpdateConfigParams) BindRequest(r *http.Request, route *middleware.Matc 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 } @@ -100,11 +108,11 @@ func (o *UpdateConfigParams) BindRequest(r *http.Request, route *middleware.Matc } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateConfigParams) bindID(rawData []string, hasKey bool, formats strfm // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/update_config_responses.go b/rest_management_api_server/operations/config/update_config_responses.go similarity index 100% rename from rest_server/operations/config/update_config_responses.go rename to rest_management_api_server/operations/config/update_config_responses.go diff --git a/rest_server/operations/config/update_config_type.go b/rest_management_api_server/operations/config/update_config_type.go similarity index 94% rename from rest_server/operations/config/update_config_type.go rename to rest_management_api_server/operations/config/update_config_type.go index f7c2d3c55..f4c54d33a 100644 --- a/rest_server/operations/config/update_config_type.go +++ b/rest_management_api_server/operations/config/update_config_type.go @@ -53,7 +53,7 @@ func NewUpdateConfigType(ctx *middleware.Context, handler UpdateConfigTypeHandle return &UpdateConfigType{Context: ctx, Handler: handler} } -/*UpdateConfigType swagger:route PUT /config-types/{id} Config updateConfigType +/* UpdateConfigType swagger:route PUT /config-types/{id} Config updateConfigType Update all fields on a config-type @@ -68,21 +68,20 @@ type UpdateConfigType struct { func (o *UpdateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/config/update_config_type_parameters.go b/rest_management_api_server/operations/config/update_config_type_parameters.go similarity index 93% rename from rest_server/operations/config/update_config_type_parameters.go rename to rest_management_api_server/operations/config/update_config_type_parameters.go index e188c8660..f00c852a1 100644 --- a/rest_server/operations/config/update_config_type_parameters.go +++ b/rest_management_api_server/operations/config/update_config_type_parameters.go @@ -30,6 +30,7 @@ package config // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateConfigTypeParams() UpdateConfigTypeParams { return UpdateConfigTypeParams{} @@ -93,6 +96,11 @@ func (o *UpdateConfigTypeParams) BindRequest(r *http.Request, route *middleware. 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 } @@ -100,11 +108,11 @@ func (o *UpdateConfigTypeParams) BindRequest(r *http.Request, route *middleware. } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateConfigTypeParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/config/update_config_type_responses.go b/rest_management_api_server/operations/config/update_config_type_responses.go similarity index 100% rename from rest_server/operations/config/update_config_type_responses.go rename to rest_management_api_server/operations/config/update_config_type_responses.go diff --git a/rest_server/operations/config/update_config_type_urlbuilder.go b/rest_management_api_server/operations/config/update_config_type_urlbuilder.go similarity index 98% rename from rest_server/operations/config/update_config_type_urlbuilder.go rename to rest_management_api_server/operations/config/update_config_type_urlbuilder.go index 4c1c833cd..540e0dc1c 100644 --- a/rest_server/operations/config/update_config_type_urlbuilder.go +++ b/rest_management_api_server/operations/config/update_config_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateConfigTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/config/update_config_urlbuilder.go b/rest_management_api_server/operations/config/update_config_urlbuilder.go similarity index 98% rename from rest_server/operations/config/update_config_urlbuilder.go rename to rest_management_api_server/operations/config/update_config_urlbuilder.go index 03d8ea745..d066e6c3f 100644 --- a/rest_server/operations/config/update_config_urlbuilder.go +++ b/rest_management_api_server/operations/config/update_config_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) 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 new file mode 100644 index 000000000..e736f55a3 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/delete_current_api_session.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d22bb81c4 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/delete_current_api_session_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..380b8883e --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/delete_current_api_session_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..36a9b8648 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d0fe329ad --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..a806f952d --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b981fd390 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..09f0715fd --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/get_current_api_session.go b/rest_management_api_server/operations/current_api_session/get_current_api_session.go new file mode 100644 index 000000000..7bcd9a715 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/get_current_api_session.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..a4d6b8e02 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/get_current_api_session_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..64e2ed265 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/get_current_api_session_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1b181ef22 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..863e8fe47 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..41ece3d8f --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6ec29f559 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + } + } +} + +// 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 new file mode 100644 index 000000000..6ac4f5b19 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..789f47662 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d2cb910c4 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f56d89558 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..bbf508e74 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..669113fd8 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6807bd672 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..219b66bb1 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..5d92e4c29 --- /dev/null +++ b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..99d5a29e4 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b114b26d8 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..43bceaa65 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..23f9f98c4 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..3f0a5b32b --- /dev/null +++ b/rest_management_api_server/operations/current_identity/delete_mfa.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..8d96e2976 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/delete_mfa_parameters.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b270aed4c --- /dev/null +++ b/rest_management_api_server/operations/current_identity/delete_mfa_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..62317e36d --- /dev/null +++ b/rest_management_api_server/operations/current_identity/delete_mfa_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4f5525646 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..7339b9edc --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..dc9596756 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..cb3f9b987 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b1d1b951d --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..7af23d979 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d4d6cab65 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c5a42cfb8 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6182f2228 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..1921fda68 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e5daee323 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e65dd4127 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/detail_mfa_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..79b30e0b9 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/enroll_mfa.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..0ac0f7152 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/enroll_mfa_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..82220d574 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/enroll_mfa_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..79bc064c9 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/enroll_mfa_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6244e7444 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/get_current_identity.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..bdcadc313 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/get_current_identity_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..170bfebca --- /dev/null +++ b/rest_management_api_server/operations/current_identity/get_current_identity_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e2ad52a37 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/get_current_identity_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..d1917534f --- /dev/null +++ b/rest_management_api_server/operations/current_identity/verify_mfa.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e33b4307f --- /dev/null +++ b/rest_management_api_server/operations/current_identity/verify_mfa_parameters.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..3980c4179 --- /dev/null +++ b/rest_management_api_server/operations/current_identity/verify_mfa_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f4c99cadc --- /dev/null +++ b/rest_management_api_server/operations/current_identity/verify_mfa_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/database/check_data_integrity.go b/rest_management_api_server/operations/database/check_data_integrity.go similarity index 93% rename from rest_server/operations/database/check_data_integrity.go rename to rest_management_api_server/operations/database/check_data_integrity.go index 80c801dbe..a07fa0204 100644 --- a/rest_server/operations/database/check_data_integrity.go +++ b/rest_management_api_server/operations/database/check_data_integrity.go @@ -53,7 +53,7 @@ func NewCheckDataIntegrity(ctx *middleware.Context, handler CheckDataIntegrityHa return &CheckDataIntegrity{Context: ctx, Handler: handler} } -/*CheckDataIntegrity swagger:route POST /database/check-data-integrity Database checkDataIntegrity +/* CheckDataIntegrity swagger:route POST /database/check-data-integrity Database checkDataIntegrity Starts a data integrity scan on the datastore @@ -68,21 +68,20 @@ type CheckDataIntegrity struct { func (o *CheckDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CheckDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/database/check_data_integrity_parameters.go b/rest_management_api_server/operations/database/check_data_integrity_parameters.go similarity index 97% rename from rest_server/operations/database/check_data_integrity_parameters.go rename to rest_management_api_server/operations/database/check_data_integrity_parameters.go index e38fe5ce3..a0877bed2 100644 --- a/rest_server/operations/database/check_data_integrity_parameters.go +++ b/rest_management_api_server/operations/database/check_data_integrity_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewCheckDataIntegrityParams creates a new CheckDataIntegrityParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCheckDataIntegrityParams() CheckDataIntegrityParams { return CheckDataIntegrityParams{} diff --git a/rest_server/operations/database/check_data_integrity_responses.go b/rest_management_api_server/operations/database/check_data_integrity_responses.go similarity index 100% rename from rest_server/operations/database/check_data_integrity_responses.go rename to rest_management_api_server/operations/database/check_data_integrity_responses.go diff --git a/rest_server/operations/database/check_data_integrity_urlbuilder.go b/rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go similarity index 98% rename from rest_server/operations/database/check_data_integrity_urlbuilder.go rename to rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go index 5d7f1b4f1..1a2ec36be 100644 --- a/rest_server/operations/database/check_data_integrity_urlbuilder.go +++ b/rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CheckDataIntegrityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/database/create_database_snapshot.go b/rest_management_api_server/operations/database/create_database_snapshot.go similarity index 93% rename from rest_server/operations/database/create_database_snapshot.go rename to rest_management_api_server/operations/database/create_database_snapshot.go index 375bf3fa5..4fce96939 100644 --- a/rest_server/operations/database/create_database_snapshot.go +++ b/rest_management_api_server/operations/database/create_database_snapshot.go @@ -53,7 +53,7 @@ func NewCreateDatabaseSnapshot(ctx *middleware.Context, handler CreateDatabaseSn return &CreateDatabaseSnapshot{Context: ctx, Handler: handler} } -/*CreateDatabaseSnapshot swagger:route POST /database/snapshot Database createDatabaseSnapshot +/* CreateDatabaseSnapshot swagger:route POST /database/snapshot Database createDatabaseSnapshot Create a new database snapshot @@ -68,21 +68,20 @@ type CreateDatabaseSnapshot struct { func (o *CreateDatabaseSnapshot) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateDatabaseSnapshot) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/database/create_database_snapshot_parameters.go b/rest_management_api_server/operations/database/create_database_snapshot_parameters.go similarity index 97% rename from rest_server/operations/database/create_database_snapshot_parameters.go rename to rest_management_api_server/operations/database/create_database_snapshot_parameters.go index 0fbd83d4c..fe058c542 100644 --- a/rest_server/operations/database/create_database_snapshot_parameters.go +++ b/rest_management_api_server/operations/database/create_database_snapshot_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewCreateDatabaseSnapshotParams creates a new CreateDatabaseSnapshotParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateDatabaseSnapshotParams() CreateDatabaseSnapshotParams { return CreateDatabaseSnapshotParams{} diff --git a/rest_server/operations/database/create_database_snapshot_responses.go b/rest_management_api_server/operations/database/create_database_snapshot_responses.go similarity index 100% rename from rest_server/operations/database/create_database_snapshot_responses.go rename to rest_management_api_server/operations/database/create_database_snapshot_responses.go diff --git a/rest_server/operations/database/create_database_snapshot_urlbuilder.go b/rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go similarity index 98% rename from rest_server/operations/database/create_database_snapshot_urlbuilder.go rename to rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go index 76b41f3d1..49223d348 100644 --- a/rest_server/operations/database/create_database_snapshot_urlbuilder.go +++ b/rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateDatabaseSnapshotURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/database/data_integrity_results.go b/rest_management_api_server/operations/database/data_integrity_results.go similarity index 93% rename from rest_server/operations/database/data_integrity_results.go rename to rest_management_api_server/operations/database/data_integrity_results.go index d935b5b96..7bb1d6577 100644 --- a/rest_server/operations/database/data_integrity_results.go +++ b/rest_management_api_server/operations/database/data_integrity_results.go @@ -53,7 +53,7 @@ func NewDataIntegrityResults(ctx *middleware.Context, handler DataIntegrityResul return &DataIntegrityResults{Context: ctx, Handler: handler} } -/*DataIntegrityResults swagger:route GET /database/data-integrity-results Database dataIntegrityResults +/* DataIntegrityResults swagger:route GET /database/data-integrity-results Database dataIntegrityResults Returns any results found from in-progress integrity checks @@ -68,21 +68,20 @@ type DataIntegrityResults struct { func (o *DataIntegrityResults) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DataIntegrityResults) ServeHTTP(rw http.ResponseWriter, r *http.Request } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/database/data_integrity_results_parameters.go b/rest_management_api_server/operations/database/data_integrity_results_parameters.go similarity index 97% rename from rest_server/operations/database/data_integrity_results_parameters.go rename to rest_management_api_server/operations/database/data_integrity_results_parameters.go index 1bfb6b03c..ecb5c482b 100644 --- a/rest_server/operations/database/data_integrity_results_parameters.go +++ b/rest_management_api_server/operations/database/data_integrity_results_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewDataIntegrityResultsParams creates a new DataIntegrityResultsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDataIntegrityResultsParams() DataIntegrityResultsParams { return DataIntegrityResultsParams{} diff --git a/rest_server/operations/database/data_integrity_results_responses.go b/rest_management_api_server/operations/database/data_integrity_results_responses.go similarity index 100% rename from rest_server/operations/database/data_integrity_results_responses.go rename to rest_management_api_server/operations/database/data_integrity_results_responses.go diff --git a/rest_server/operations/database/data_integrity_results_urlbuilder.go b/rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go similarity index 98% rename from rest_server/operations/database/data_integrity_results_urlbuilder.go rename to rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go index 74733060f..50d55f355 100644 --- a/rest_server/operations/database/data_integrity_results_urlbuilder.go +++ b/rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go @@ -63,7 +63,7 @@ func (o *DataIntegrityResultsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/database/fix_data_integrity.go b/rest_management_api_server/operations/database/fix_data_integrity.go similarity index 94% rename from rest_server/operations/database/fix_data_integrity.go rename to rest_management_api_server/operations/database/fix_data_integrity.go index ecd1f0b66..10fd0ec8f 100644 --- a/rest_server/operations/database/fix_data_integrity.go +++ b/rest_management_api_server/operations/database/fix_data_integrity.go @@ -53,7 +53,7 @@ func NewFixDataIntegrity(ctx *middleware.Context, handler FixDataIntegrityHandle return &FixDataIntegrity{Context: ctx, Handler: handler} } -/*FixDataIntegrity swagger:route POST /database/fix-data-integrity Database fixDataIntegrity +/* 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 @@ -68,21 +68,20 @@ type FixDataIntegrity struct { func (o *FixDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *FixDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/database/fix_data_integrity_parameters.go b/rest_management_api_server/operations/database/fix_data_integrity_parameters.go similarity index 97% rename from rest_server/operations/database/fix_data_integrity_parameters.go rename to rest_management_api_server/operations/database/fix_data_integrity_parameters.go index 993acd094..6b4aa690b 100644 --- a/rest_server/operations/database/fix_data_integrity_parameters.go +++ b/rest_management_api_server/operations/database/fix_data_integrity_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewFixDataIntegrityParams creates a new FixDataIntegrityParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewFixDataIntegrityParams() FixDataIntegrityParams { return FixDataIntegrityParams{} diff --git a/rest_server/operations/database/fix_data_integrity_responses.go b/rest_management_api_server/operations/database/fix_data_integrity_responses.go similarity index 100% rename from rest_server/operations/database/fix_data_integrity_responses.go rename to rest_management_api_server/operations/database/fix_data_integrity_responses.go diff --git a/rest_server/operations/database/fix_data_integrity_urlbuilder.go b/rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go similarity index 98% rename from rest_server/operations/database/fix_data_integrity_urlbuilder.go rename to rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go index 170ec501d..5e10bdf6b 100644 --- a/rest_server/operations/database/fix_data_integrity_urlbuilder.go +++ b/rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go @@ -63,7 +63,7 @@ func (o *FixDataIntegrityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/create_edge_router.go b/rest_management_api_server/operations/edge_router/create_edge_router.go similarity index 94% rename from rest_server/operations/edge_router/create_edge_router.go rename to rest_management_api_server/operations/edge_router/create_edge_router.go index b836af929..37f18e51c 100644 --- a/rest_server/operations/edge_router/create_edge_router.go +++ b/rest_management_api_server/operations/edge_router/create_edge_router.go @@ -53,7 +53,7 @@ func NewCreateEdgeRouter(ctx *middleware.Context, handler CreateEdgeRouterHandle return &CreateEdgeRouter{Context: ctx, Handler: handler} } -/*CreateEdgeRouter swagger:route POST /edge-routers Edge Router createEdgeRouter +/* CreateEdgeRouter swagger:route POST /edge-routers Edge Router createEdgeRouter Create an edge router @@ -68,21 +68,20 @@ type CreateEdgeRouter struct { func (o *CreateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/create_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/create_edge_router_parameters.go similarity index 92% rename from rest_server/operations/edge_router/create_edge_router_parameters.go rename to rest_management_api_server/operations/edge_router/create_edge_router_parameters.go index 3c9d92bce..747baf5e2 100644 --- a/rest_server/operations/edge_router/create_edge_router_parameters.go +++ b/rest_management_api_server/operations/edge_router/create_edge_router_parameters.go @@ -30,18 +30,21 @@ package edge_router // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateEdgeRouterParams() CreateEdgeRouterParams { return CreateEdgeRouterParams{} @@ -87,6 +90,11 @@ func (o *CreateEdgeRouterParams) BindRequest(r *http.Request, route *middleware. 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 } diff --git a/rest_server/operations/edge_router/create_edge_router_responses.go b/rest_management_api_server/operations/edge_router/create_edge_router_responses.go similarity index 100% rename from rest_server/operations/edge_router/create_edge_router_responses.go rename to rest_management_api_server/operations/edge_router/create_edge_router_responses.go diff --git a/rest_server/operations/edge_router/create_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go similarity index 98% rename from rest_server/operations/edge_router/create_edge_router_urlbuilder.go rename to rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go index e636d9b30..a9eb5937b 100644 --- a/rest_server/operations/edge_router/create_edge_router_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateEdgeRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/delete_edge_router.go b/rest_management_api_server/operations/edge_router/delete_edge_router.go similarity index 93% rename from rest_server/operations/edge_router/delete_edge_router.go rename to rest_management_api_server/operations/edge_router/delete_edge_router.go index 7488160fc..796fde8b2 100644 --- a/rest_server/operations/edge_router/delete_edge_router.go +++ b/rest_management_api_server/operations/edge_router/delete_edge_router.go @@ -53,7 +53,7 @@ func NewDeleteEdgeRouter(ctx *middleware.Context, handler DeleteEdgeRouterHandle return &DeleteEdgeRouter{Context: ctx, Handler: handler} } -/*DeleteEdgeRouter swagger:route DELETE /edge-routers/{id} Edge Router deleteEdgeRouter +/* DeleteEdgeRouter swagger:route DELETE /edge-routers/{id} Edge Router deleteEdgeRouter Delete an edge router @@ -68,21 +68,20 @@ type DeleteEdgeRouter struct { func (o *DeleteEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/delete_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go similarity index 98% rename from rest_server/operations/edge_router/delete_edge_router_parameters.go rename to rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go index b6ac991d9..d837afd5a 100644 --- a/rest_server/operations/edge_router/delete_edge_router_parameters.go +++ b/rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteEdgeRouterParams creates a new DeleteEdgeRouterParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteEdgeRouterParams() DeleteEdgeRouterParams { return DeleteEdgeRouterParams{} @@ -73,7 +74,6 @@ func (o *DeleteEdgeRouterParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteEdgeRouterParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/delete_edge_router_responses.go b/rest_management_api_server/operations/edge_router/delete_edge_router_responses.go similarity index 100% rename from rest_server/operations/edge_router/delete_edge_router_responses.go rename to rest_management_api_server/operations/edge_router/delete_edge_router_responses.go diff --git a/rest_server/operations/edge_router/delete_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go similarity index 98% rename from rest_server/operations/edge_router/delete_edge_router_urlbuilder.go rename to rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go index 77a90d347..7c98ceffd 100644 --- a/rest_server/operations/edge_router/delete_edge_router_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteEdgeRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/detail_edge_router.go b/rest_management_api_server/operations/edge_router/detail_edge_router.go similarity index 94% rename from rest_server/operations/edge_router/detail_edge_router.go rename to rest_management_api_server/operations/edge_router/detail_edge_router.go index 93b73edba..9d3081a4a 100644 --- a/rest_server/operations/edge_router/detail_edge_router.go +++ b/rest_management_api_server/operations/edge_router/detail_edge_router.go @@ -53,7 +53,7 @@ func NewDetailEdgeRouter(ctx *middleware.Context, handler DetailEdgeRouterHandle return &DetailEdgeRouter{Context: ctx, Handler: handler} } -/*DetailEdgeRouter swagger:route GET /edge-routers/{id} Edge Router detailEdgeRouter +/* DetailEdgeRouter swagger:route GET /edge-routers/{id} Edge Router detailEdgeRouter Retrieves a single edge router @@ -68,21 +68,20 @@ type DetailEdgeRouter struct { func (o *DetailEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/detail_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go similarity index 98% rename from rest_server/operations/edge_router/detail_edge_router_parameters.go rename to rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go index b61af7363..2b2ce93b6 100644 --- a/rest_server/operations/edge_router/detail_edge_router_parameters.go +++ b/rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailEdgeRouterParams creates a new DetailEdgeRouterParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailEdgeRouterParams() DetailEdgeRouterParams { return DetailEdgeRouterParams{} @@ -73,7 +74,6 @@ func (o *DetailEdgeRouterParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailEdgeRouterParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/detail_edge_router_responses.go b/rest_management_api_server/operations/edge_router/detail_edge_router_responses.go similarity index 100% rename from rest_server/operations/edge_router/detail_edge_router_responses.go rename to rest_management_api_server/operations/edge_router/detail_edge_router_responses.go diff --git a/rest_server/operations/edge_router/detail_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go similarity index 98% rename from rest_server/operations/edge_router/detail_edge_router_urlbuilder.go rename to rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go index a62a3a1a7..bb594ba8a 100644 --- a/rest_server/operations/edge_router/detail_edge_router_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailEdgeRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/edge_router/list_edge_router_edge_router_policies.go rename to rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies.go index d552022e1..b44d868e1 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListEdgeRouterEdgeRouterPolicies(ctx *middleware.Context, handler ListEd return &ListEdgeRouterEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListEdgeRouterEdgeRouterPolicies swagger:route GET /edge-routers/{id}/edge-router-policies Edge Router listEdgeRouterEdgeRouterPolicies +/* ListEdgeRouterEdgeRouterPolicies swagger:route GET /edge-routers/{id}/edge-router-policies Edge Router listEdgeRouterEdgeRouterPolicies List the edge router policies that affect an edge router @@ -68,21 +68,20 @@ type ListEdgeRouterEdgeRouterPolicies struct { func (o *ListEdgeRouterEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListEdgeRouterEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r * } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router/list_edge_router_edge_router_policies_parameters.go rename to rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_parameters.go index d1c1201cb..a5ac02906 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterEdgeRouterPoliciesParams creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterEdgeRouterPoliciesParams() ListEdgeRouterEdgeRouterPoliciesParams { return ListEdgeRouterEdgeRouterPoliciesParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterEdgeRouterPoliciesParams) BindRequest(r *http.Request, ro if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterEdgeRouterPoliciesParams) bindID(rawData []string, hasKey // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router/list_edge_router_edge_router_policies_responses.go rename to rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go index f9d720f8d..8aa225fe4 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListEdgeRouterEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/list_edge_router_identities.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities.go similarity index 93% rename from rest_server/operations/edge_router/list_edge_router_identities.go rename to rest_management_api_server/operations/edge_router/list_edge_router_identities.go index 4ae5f1730..59ec244d7 100644 --- a/rest_server/operations/edge_router/list_edge_router_identities.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_identities.go @@ -53,7 +53,7 @@ func NewListEdgeRouterIdentities(ctx *middleware.Context, handler ListEdgeRouter return &ListEdgeRouterIdentities{Context: ctx, Handler: handler} } -/*ListEdgeRouterIdentities swagger:route GET /edge-routers/{id}/identities Edge Router listEdgeRouterIdentities +/* ListEdgeRouterIdentities swagger:route GET /edge-routers/{id}/identities Edge Router listEdgeRouterIdentities List associated identities @@ -69,21 +69,20 @@ type ListEdgeRouterIdentities struct { func (o *ListEdgeRouterIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Req } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/list_edge_router_identities_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go similarity index 98% rename from rest_server/operations/edge_router/list_edge_router_identities_parameters.go rename to rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go index 414d043c0..10c3ada57 100644 --- a/rest_server/operations/edge_router/list_edge_router_identities_parameters.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterIdentitiesParams creates a new ListEdgeRouterIdentitiesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterIdentitiesParams() ListEdgeRouterIdentitiesParams { return ListEdgeRouterIdentitiesParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterIdentitiesParams) BindRequest(r *http.Request, route *mid if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterIdentitiesParams) bindID(rawData []string, hasKey bool, f // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/list_edge_router_identities_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_responses.go similarity index 100% rename from rest_server/operations/edge_router/list_edge_router_identities_responses.go rename to rest_management_api_server/operations/edge_router/list_edge_router_identities_responses.go diff --git a/rest_server/operations/edge_router/list_edge_router_identities_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go similarity index 99% rename from rest_server/operations/edge_router/list_edge_router_identities_urlbuilder.go rename to rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go index 27a8c753d..a5acf09f5 100644 --- a/rest_server/operations/edge_router/list_edge_router_identities_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListEdgeRouterIdentitiesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/edge_router/list_edge_router_service_edge_router_policies.go rename to rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies.go index 2f0fc1e35..a75131a3a 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListEdgeRouterServiceEdgeRouterPolicies(ctx *middleware.Context, handler return &ListEdgeRouterServiceEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListEdgeRouterServiceEdgeRouterPolicies swagger:route GET /edge-routers/{id}/service-edge-router-policies Edge Router listEdgeRouterServiceEdgeRouterPolicies +/* ListEdgeRouterServiceEdgeRouterPolicies swagger:route GET /edge-routers/{id}/service-edge-router-policies Edge Router listEdgeRouterServiceEdgeRouterPolicies List the service policies that affect an edge router @@ -68,21 +68,20 @@ type ListEdgeRouterServiceEdgeRouterPolicies struct { func (o *ListEdgeRouterServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListEdgeRouterServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWrit } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go rename to rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go index 98bd5ff16..2bdd33944 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterServiceEdgeRouterPoliciesParams creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterServiceEdgeRouterPoliciesParams() ListEdgeRouterServiceEdgeRouterPoliciesParams { return ListEdgeRouterServiceEdgeRouterPoliciesParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) BindRequest(r *http.Requ if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) bindID(rawData []string, // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go rename to rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go index 40b1ddc9e..da97f4bb3 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/list_edge_router_services.go b/rest_management_api_server/operations/edge_router/list_edge_router_services.go similarity index 93% rename from rest_server/operations/edge_router/list_edge_router_services.go rename to rest_management_api_server/operations/edge_router/list_edge_router_services.go index b0cc1eb70..1310d44b6 100644 --- a/rest_server/operations/edge_router/list_edge_router_services.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_services.go @@ -53,7 +53,7 @@ func NewListEdgeRouterServices(ctx *middleware.Context, handler ListEdgeRouterSe return &ListEdgeRouterServices{Context: ctx, Handler: handler} } -/*ListEdgeRouterServices swagger:route GET /edge-routers/{id}/services Edge Router listEdgeRouterServices +/* ListEdgeRouterServices swagger:route GET /edge-routers/{id}/services Edge Router listEdgeRouterServices List associated services @@ -69,21 +69,20 @@ type ListEdgeRouterServices struct { func (o *ListEdgeRouterServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterServices) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/list_edge_router_services_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go similarity index 98% rename from rest_server/operations/edge_router/list_edge_router_services_parameters.go rename to rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go index 3ba24e28b..0cee45fe9 100644 --- a/rest_server/operations/edge_router/list_edge_router_services_parameters.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterServicesParams creates a new ListEdgeRouterServicesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterServicesParams() ListEdgeRouterServicesParams { return ListEdgeRouterServicesParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterServicesParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterServicesParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/list_edge_router_services_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_responses.go similarity index 100% rename from rest_server/operations/edge_router/list_edge_router_services_responses.go rename to rest_management_api_server/operations/edge_router/list_edge_router_services_responses.go diff --git a/rest_server/operations/edge_router/list_edge_router_services_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go similarity index 99% rename from rest_server/operations/edge_router/list_edge_router_services_urlbuilder.go rename to rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go index 373e9f866..dea9a4411 100644 --- a/rest_server/operations/edge_router/list_edge_router_services_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListEdgeRouterServicesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/list_edge_routers.go b/rest_management_api_server/operations/edge_router/list_edge_routers.go similarity index 94% rename from rest_server/operations/edge_router/list_edge_routers.go rename to rest_management_api_server/operations/edge_router/list_edge_routers.go index b796c6c92..ae10569ed 100644 --- a/rest_server/operations/edge_router/list_edge_routers.go +++ b/rest_management_api_server/operations/edge_router/list_edge_routers.go @@ -53,7 +53,7 @@ func NewListEdgeRouters(ctx *middleware.Context, handler ListEdgeRoutersHandler) return &ListEdgeRouters{Context: ctx, Handler: handler} } -/*ListEdgeRouters swagger:route GET /edge-routers Edge Router listEdgeRouters +/* ListEdgeRouters swagger:route GET /edge-routers Edge Router listEdgeRouters List edge routers @@ -69,21 +69,20 @@ type ListEdgeRouters struct { func (o *ListEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/list_edge_routers_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go similarity index 99% rename from rest_server/operations/edge_router/list_edge_routers_parameters.go rename to rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go index d5c87a50a..ef4c11ec3 100644 --- a/rest_server/operations/edge_router/list_edge_routers_parameters.go +++ b/rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListEdgeRoutersParams creates a new ListEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRoutersParams() ListEdgeRoutersParams { return ListEdgeRoutersParams{} @@ -113,7 +114,6 @@ func (o *ListEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.M if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -129,10 +129,10 @@ func (o *ListEdgeRoutersParams) bindFilter(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -147,6 +147,7 @@ func (o *ListEdgeRoutersParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -169,6 +170,7 @@ func (o *ListEdgeRoutersParams) bindOffset(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -186,10 +188,8 @@ func (o *ListEdgeRoutersParams) bindOffset(rawData []string, hasKey bool, format // // 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 } @@ -215,10 +215,10 @@ func (o *ListEdgeRoutersParams) bindRoleSemantic(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.RoleSemantic = &raw return nil diff --git a/rest_server/operations/edge_router/list_edge_routers_responses.go b/rest_management_api_server/operations/edge_router/list_edge_routers_responses.go similarity index 100% rename from rest_server/operations/edge_router/list_edge_routers_responses.go rename to rest_management_api_server/operations/edge_router/list_edge_routers_responses.go diff --git a/rest_server/operations/edge_router/list_edge_routers_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go similarity index 99% rename from rest_server/operations/edge_router/list_edge_routers_urlbuilder.go rename to rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go index 769c56c5d..ae7a7c5c5 100644 --- a/rest_server/operations/edge_router/list_edge_routers_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go @@ -73,7 +73,7 @@ func (o *ListEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/patch_edge_router.go b/rest_management_api_server/operations/edge_router/patch_edge_router.go similarity index 94% rename from rest_server/operations/edge_router/patch_edge_router.go rename to rest_management_api_server/operations/edge_router/patch_edge_router.go index d11bdaad0..fea52ab4c 100644 --- a/rest_server/operations/edge_router/patch_edge_router.go +++ b/rest_management_api_server/operations/edge_router/patch_edge_router.go @@ -53,7 +53,7 @@ func NewPatchEdgeRouter(ctx *middleware.Context, handler PatchEdgeRouterHandler) return &PatchEdgeRouter{Context: ctx, Handler: handler} } -/*PatchEdgeRouter swagger:route PATCH /edge-routers/{id} Edge Router patchEdgeRouter +/* PatchEdgeRouter swagger:route PATCH /edge-routers/{id} Edge Router patchEdgeRouter Update the supplied fields on an edge router @@ -68,21 +68,20 @@ type PatchEdgeRouter struct { func (o *PatchEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/patch_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go similarity index 93% rename from rest_server/operations/edge_router/patch_edge_router_parameters.go rename to rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go index 941b48dc2..c78c81e39 100644 --- a/rest_server/operations/edge_router/patch_edge_router_parameters.go +++ b/rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go @@ -30,6 +30,7 @@ package edge_router // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchEdgeRouterParams() PatchEdgeRouterParams { return PatchEdgeRouterParams{} @@ -93,6 +96,11 @@ func (o *PatchEdgeRouterParams) BindRequest(r *http.Request, route *middleware.M 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 } @@ -100,11 +108,11 @@ func (o *PatchEdgeRouterParams) BindRequest(r *http.Request, route *middleware.M } 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...) } @@ -120,7 +128,6 @@ func (o *PatchEdgeRouterParams) bindID(rawData []string, hasKey bool, formats st // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/patch_edge_router_responses.go b/rest_management_api_server/operations/edge_router/patch_edge_router_responses.go similarity index 100% rename from rest_server/operations/edge_router/patch_edge_router_responses.go rename to rest_management_api_server/operations/edge_router/patch_edge_router_responses.go diff --git a/rest_server/operations/edge_router/patch_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go similarity index 98% rename from rest_server/operations/edge_router/patch_edge_router_urlbuilder.go rename to rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go index e86d8c0be..a2b951dc9 100644 --- a/rest_server/operations/edge_router/patch_edge_router_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchEdgeRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router/update_edge_router.go b/rest_management_api_server/operations/edge_router/update_edge_router.go similarity index 94% rename from rest_server/operations/edge_router/update_edge_router.go rename to rest_management_api_server/operations/edge_router/update_edge_router.go index b15705d9b..2a8a0c272 100644 --- a/rest_server/operations/edge_router/update_edge_router.go +++ b/rest_management_api_server/operations/edge_router/update_edge_router.go @@ -53,7 +53,7 @@ func NewUpdateEdgeRouter(ctx *middleware.Context, handler UpdateEdgeRouterHandle return &UpdateEdgeRouter{Context: ctx, Handler: handler} } -/*UpdateEdgeRouter swagger:route PUT /edge-routers/{id} Edge Router updateEdgeRouter +/* UpdateEdgeRouter swagger:route PUT /edge-routers/{id} Edge Router updateEdgeRouter Update all fields on an edge router @@ -68,21 +68,20 @@ type UpdateEdgeRouter struct { func (o *UpdateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/edge_router/update_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/update_edge_router_parameters.go similarity index 93% rename from rest_server/operations/edge_router/update_edge_router_parameters.go rename to rest_management_api_server/operations/edge_router/update_edge_router_parameters.go index e7292636f..24e23cc93 100644 --- a/rest_server/operations/edge_router/update_edge_router_parameters.go +++ b/rest_management_api_server/operations/edge_router/update_edge_router_parameters.go @@ -30,6 +30,7 @@ package edge_router // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateEdgeRouterParams() UpdateEdgeRouterParams { return UpdateEdgeRouterParams{} @@ -93,6 +96,11 @@ func (o *UpdateEdgeRouterParams) BindRequest(r *http.Request, route *middleware. 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 } @@ -100,11 +108,11 @@ func (o *UpdateEdgeRouterParams) BindRequest(r *http.Request, route *middleware. } 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...) } @@ -120,7 +128,6 @@ func (o *UpdateEdgeRouterParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/edge_router/update_edge_router_responses.go b/rest_management_api_server/operations/edge_router/update_edge_router_responses.go similarity index 100% rename from rest_server/operations/edge_router/update_edge_router_responses.go rename to rest_management_api_server/operations/edge_router/update_edge_router_responses.go diff --git a/rest_server/operations/edge_router/update_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go similarity index 98% rename from rest_server/operations/edge_router/update_edge_router_urlbuilder.go rename to rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go index dbf650faa..25b090b7c 100644 --- a/rest_server/operations/edge_router/update_edge_router_urlbuilder.go +++ b/rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateEdgeRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/create_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go similarity index 93% rename from rest_server/operations/edge_router_policy/create_edge_router_policy.go rename to rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go index 9a3ec340d..8e00aa4a1 100644 --- a/rest_server/operations/edge_router_policy/create_edge_router_policy.go +++ b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go @@ -53,7 +53,7 @@ func NewCreateEdgeRouterPolicy(ctx *middleware.Context, handler CreateEdgeRouter return &CreateEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*CreateEdgeRouterPolicy swagger:route POST /edge-router-policies Edge Router Policy createEdgeRouterPolicy +/* CreateEdgeRouterPolicy swagger:route POST /edge-router-policies Edge Router Policy createEdgeRouterPolicy Create an edge router policy resource @@ -68,21 +68,20 @@ type CreateEdgeRouterPolicy struct { func (o *CreateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 92% rename from rest_server/operations/edge_router_policy/create_edge_router_policy_parameters.go rename to rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_parameters.go index 20202dfb5..334b7f4c3 100644 --- a/rest_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 @@ -30,18 +30,21 @@ package edge_router_policy // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateEdgeRouterPolicyParams() CreateEdgeRouterPolicyParams { return CreateEdgeRouterPolicyParams{} @@ -87,6 +90,11 @@ func (o *CreateEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middl 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 } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/create_edge_router_policy_responses.go rename to rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_responses.go diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go index 8b2d1fd5b..718e3b7ac 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *CreateEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/delete_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go similarity index 93% rename from rest_server/operations/edge_router_policy/delete_edge_router_policy.go rename to rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go index 11bf00cb3..09ff045eb 100644 --- a/rest_server/operations/edge_router_policy/delete_edge_router_policy.go +++ b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go @@ -53,7 +53,7 @@ func NewDeleteEdgeRouterPolicy(ctx *middleware.Context, handler DeleteEdgeRouter return &DeleteEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*DeleteEdgeRouterPolicy swagger:route DELETE /edge-router-policies/{id} Edge Router Policy deleteEdgeRouterPolicy +/* DeleteEdgeRouterPolicy swagger:route DELETE /edge-router-policies/{id} Edge Router Policy deleteEdgeRouterPolicy Delete an edge router policy @@ -68,21 +68,20 @@ type DeleteEdgeRouterPolicy struct { func (o *DeleteEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/delete_edge_router_policy_parameters.go rename to rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_parameters.go index 106007a95..bf3fc378f 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDeleteEdgeRouterPolicyParams creates a new DeleteEdgeRouterPolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteEdgeRouterPolicyParams() DeleteEdgeRouterPolicyParams { return DeleteEdgeRouterPolicyParams{} @@ -73,7 +74,6 @@ func (o *DeleteEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/delete_edge_router_policy_responses.go rename to rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go index f7cb2afbb..87626a129 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DeleteEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/detail_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go similarity index 93% rename from rest_server/operations/edge_router_policy/detail_edge_router_policy.go rename to rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go index 115288b20..f86c20c36 100644 --- a/rest_server/operations/edge_router_policy/detail_edge_router_policy.go +++ b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go @@ -53,7 +53,7 @@ func NewDetailEdgeRouterPolicy(ctx *middleware.Context, handler DetailEdgeRouter return &DetailEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*DetailEdgeRouterPolicy swagger:route GET /edge-router-policies/{id} Edge Router Policy detailEdgeRouterPolicy +/* DetailEdgeRouterPolicy swagger:route GET /edge-router-policies/{id} Edge Router Policy detailEdgeRouterPolicy Retrieves a single edge router policy @@ -68,21 +68,20 @@ type DetailEdgeRouterPolicy struct { func (o *DetailEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/detail_edge_router_policy_parameters.go rename to rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_parameters.go index 18f1ef919..9541e628d 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDetailEdgeRouterPolicyParams creates a new DetailEdgeRouterPolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailEdgeRouterPolicyParams() DetailEdgeRouterPolicyParams { return DetailEdgeRouterPolicyParams{} @@ -73,7 +74,6 @@ func (o *DetailEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/detail_edge_router_policy_responses.go rename to rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go index 2d8f31e21..a7540293a 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DetailEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/list_edge_router_policies.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go similarity index 93% rename from rest_server/operations/edge_router_policy/list_edge_router_policies.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go index 1514a1029..7451adbd6 100644 --- a/rest_server/operations/edge_router_policy/list_edge_router_policies.go +++ b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go @@ -53,7 +53,7 @@ func NewListEdgeRouterPolicies(ctx *middleware.Context, handler ListEdgeRouterPo return &ListEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListEdgeRouterPolicies swagger:route GET /edge-router-policies Edge Router Policy listEdgeRouterPolicies +/* ListEdgeRouterPolicies swagger:route GET /edge-router-policies Edge Router Policy listEdgeRouterPolicies List edge router policies @@ -69,21 +69,20 @@ type ListEdgeRouterPolicies struct { func (o *ListEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/list_edge_router_policies_parameters.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_parameters.go index 1b039e5c1..a0bb7c4b3 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListEdgeRouterPoliciesParams creates a new ListEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterPoliciesParams() ListEdgeRouterPoliciesParams { return ListEdgeRouterPoliciesParams{} @@ -94,7 +95,6 @@ func (o *ListEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middl if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListEdgeRouterPoliciesParams) bindFilter(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListEdgeRouterPoliciesParams) bindLimit(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListEdgeRouterPoliciesParams) bindOffset(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/list_edge_router_policies_responses.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go index 03d2c610c..49f91467b 100644 --- a/rest_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 @@ -71,7 +71,7 @@ func (o *ListEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_edge_routers.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers.go index 1ca211fac..3db5a790c 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListEdgeRouterPolicyEdgeRouters(ctx *middleware.Context, handler ListEdg return &ListEdgeRouterPolicyEdgeRouters{Context: ctx, Handler: handler} } -/*ListEdgeRouterPolicyEdgeRouters swagger:route GET /edge-router-policies/{id}/edge-routers Edge Router Policy listEdgeRouterPolicyEdgeRouters +/* ListEdgeRouterPolicyEdgeRouters swagger:route GET /edge-router-policies/{id}/edge-routers Edge Router Policy listEdgeRouterPolicyEdgeRouters List edge routers a policy affects @@ -69,21 +69,20 @@ type ListEdgeRouterPolicyEdgeRouters struct { func (o *ListEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *h } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go index af44b723f..8ff92b73f 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterPolicyEdgeRoutersParams creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterPolicyEdgeRoutersParams() ListEdgeRouterPolicyEdgeRoutersParams { return ListEdgeRouterPolicyEdgeRoutersParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterPolicyEdgeRoutersParams) BindRequest(r *http.Request, rou if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterPolicyEdgeRoutersParams) bindID(rawData []string, hasKey // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go index b8130e20e..40aff6a7c 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListEdgeRouterPolicyEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_identities.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities.go index b2174355e..82cb17f81 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListEdgeRouterPolicyIdentities(ctx *middleware.Context, handler ListEdge return &ListEdgeRouterPolicyIdentities{Context: ctx, Handler: handler} } -/*ListEdgeRouterPolicyIdentities swagger:route GET /edge-router-policies/{id}/identities Edge Router Policy listEdgeRouterPolicyIdentities +/* ListEdgeRouterPolicyIdentities swagger:route GET /edge-router-policies/{id}/identities Edge Router Policy listEdgeRouterPolicyIdentities List identities an edge router policy affects @@ -69,21 +69,20 @@ type ListEdgeRouterPolicyIdentities struct { func (o *ListEdgeRouterPolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterPolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *ht } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go index a17ff717a..f58ed38fd 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListEdgeRouterPolicyIdentitiesParams creates a new ListEdgeRouterPolicyIdentitiesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterPolicyIdentitiesParams() ListEdgeRouterPolicyIdentitiesParams { return ListEdgeRouterPolicyIdentitiesParams{} @@ -73,7 +74,6 @@ func (o *ListEdgeRouterPolicyIdentitiesParams) BindRequest(r *http.Request, rout if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListEdgeRouterPolicyIdentitiesParams) bindID(rawData []string, hasKey b // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_identities_responses.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go index ff8b196d2..cc201bbee 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListEdgeRouterPolicyIdentitiesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/patch_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go similarity index 93% rename from rest_server/operations/edge_router_policy/patch_edge_router_policy.go rename to rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go index 56c98b22f..73df6a990 100644 --- a/rest_server/operations/edge_router_policy/patch_edge_router_policy.go +++ b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go @@ -53,7 +53,7 @@ func NewPatchEdgeRouterPolicy(ctx *middleware.Context, handler PatchEdgeRouterPo return &PatchEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*PatchEdgeRouterPolicy swagger:route PATCH /edge-router-policies/{id} Edge Router Policy patchEdgeRouterPolicy +/* PatchEdgeRouterPolicy swagger:route PATCH /edge-router-policies/{id} Edge Router Policy patchEdgeRouterPolicy Update the supplied fields on an edge router policy @@ -68,21 +68,20 @@ type PatchEdgeRouterPolicy struct { func (o *PatchEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Reques } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/edge_router_policy/patch_edge_router_policy_parameters.go rename to rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_parameters.go index 20e7d9397..3e6156f56 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package edge_router_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchEdgeRouterPolicyParams() PatchEdgeRouterPolicyParams { return PatchEdgeRouterPolicyParams{} @@ -98,6 +101,11 @@ func (o *PatchEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middle 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 } @@ -120,7 +128,6 @@ func (o *PatchEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, form // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/patch_edge_router_policy_responses.go rename to rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go index 515a0a9bc..551693c74 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *PatchEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/edge_router_policy/update_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go similarity index 93% rename from rest_server/operations/edge_router_policy/update_edge_router_policy.go rename to rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go index 59200cb7e..13c24817f 100644 --- a/rest_server/operations/edge_router_policy/update_edge_router_policy.go +++ b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go @@ -53,7 +53,7 @@ func NewUpdateEdgeRouterPolicy(ctx *middleware.Context, handler UpdateEdgeRouter return &UpdateEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*UpdateEdgeRouterPolicy swagger:route PUT /edge-router-policies/{id} Edge Router Policy updateEdgeRouterPolicy +/* UpdateEdgeRouterPolicy swagger:route PUT /edge-router-policies/{id} Edge Router Policy updateEdgeRouterPolicy Update all fields on an edge router policy @@ -68,21 +68,20 @@ type UpdateEdgeRouterPolicy struct { func (o *UpdateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/edge_router_policy/update_edge_router_policy_parameters.go rename to rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_parameters.go index f340e7098..61e979f54 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package edge_router_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateEdgeRouterPolicyParams() UpdateEdgeRouterPolicyParams { return UpdateEdgeRouterPolicyParams{} @@ -98,6 +101,11 @@ func (o *UpdateEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middl 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 } @@ -120,7 +128,6 @@ func (o *UpdateEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/edge_router_policy/update_edge_router_policy_responses.go rename to rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go index c20cc8d5a..33c524d75 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *UpdateEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enrollment/delete_enrollment.go b/rest_management_api_server/operations/enrollment/delete_enrollment.go similarity index 93% rename from rest_server/operations/enrollment/delete_enrollment.go rename to rest_management_api_server/operations/enrollment/delete_enrollment.go index 6d14272d5..e0f7bc8f9 100644 --- a/rest_server/operations/enrollment/delete_enrollment.go +++ b/rest_management_api_server/operations/enrollment/delete_enrollment.go @@ -53,7 +53,7 @@ func NewDeleteEnrollment(ctx *middleware.Context, handler DeleteEnrollmentHandle return &DeleteEnrollment{Context: ctx, Handler: handler} } -/*DeleteEnrollment swagger:route DELETE /enrollments/{id} Enrollment deleteEnrollment +/* DeleteEnrollment swagger:route DELETE /enrollments/{id} Enrollment deleteEnrollment Delete an outstanding enrollment @@ -68,21 +68,20 @@ type DeleteEnrollment struct { func (o *DeleteEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/enrollment/delete_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go similarity index 98% rename from rest_server/operations/enrollment/delete_enrollment_parameters.go rename to rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go index 13a7bdd44..9805c9042 100644 --- a/rest_server/operations/enrollment/delete_enrollment_parameters.go +++ b/rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteEnrollmentParams creates a new DeleteEnrollmentParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteEnrollmentParams() DeleteEnrollmentParams { return DeleteEnrollmentParams{} @@ -73,7 +74,6 @@ func (o *DeleteEnrollmentParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteEnrollmentParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/enrollment/delete_enrollment_responses.go b/rest_management_api_server/operations/enrollment/delete_enrollment_responses.go similarity index 100% rename from rest_server/operations/enrollment/delete_enrollment_responses.go rename to rest_management_api_server/operations/enrollment/delete_enrollment_responses.go diff --git a/rest_server/operations/enrollment/delete_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go similarity index 98% rename from rest_server/operations/enrollment/delete_enrollment_urlbuilder.go rename to rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go index 31aec229e..6ab033c48 100644 --- a/rest_server/operations/enrollment/delete_enrollment_urlbuilder.go +++ b/rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteEnrollmentURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enrollment/detail_enrollment.go b/rest_management_api_server/operations/enrollment/detail_enrollment.go similarity index 94% rename from rest_server/operations/enrollment/detail_enrollment.go rename to rest_management_api_server/operations/enrollment/detail_enrollment.go index 3f81011ac..f2f281cb6 100644 --- a/rest_server/operations/enrollment/detail_enrollment.go +++ b/rest_management_api_server/operations/enrollment/detail_enrollment.go @@ -53,7 +53,7 @@ func NewDetailEnrollment(ctx *middleware.Context, handler DetailEnrollmentHandle return &DetailEnrollment{Context: ctx, Handler: handler} } -/*DetailEnrollment swagger:route GET /enrollments/{id} Enrollment detailEnrollment +/* DetailEnrollment swagger:route GET /enrollments/{id} Enrollment detailEnrollment Retrieves an outstanding enrollment @@ -68,21 +68,20 @@ type DetailEnrollment struct { func (o *DetailEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/enrollment/detail_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go similarity index 98% rename from rest_server/operations/enrollment/detail_enrollment_parameters.go rename to rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go index 81e31ccac..602ac4775 100644 --- a/rest_server/operations/enrollment/detail_enrollment_parameters.go +++ b/rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailEnrollmentParams creates a new DetailEnrollmentParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailEnrollmentParams() DetailEnrollmentParams { return DetailEnrollmentParams{} @@ -73,7 +74,6 @@ func (o *DetailEnrollmentParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailEnrollmentParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/enrollment/detail_enrollment_responses.go b/rest_management_api_server/operations/enrollment/detail_enrollment_responses.go similarity index 100% rename from rest_server/operations/enrollment/detail_enrollment_responses.go rename to rest_management_api_server/operations/enrollment/detail_enrollment_responses.go diff --git a/rest_server/operations/enrollment/detail_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go similarity index 98% rename from rest_server/operations/enrollment/detail_enrollment_urlbuilder.go rename to rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go index 3011aab1f..f0483d42d 100644 --- a/rest_server/operations/enrollment/detail_enrollment_urlbuilder.go +++ b/rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailEnrollmentURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/enrollment/list_enrollments.go b/rest_management_api_server/operations/enrollment/list_enrollments.go similarity index 94% rename from rest_server/operations/enrollment/list_enrollments.go rename to rest_management_api_server/operations/enrollment/list_enrollments.go index 3c2e5948d..0c08d5368 100644 --- a/rest_server/operations/enrollment/list_enrollments.go +++ b/rest_management_api_server/operations/enrollment/list_enrollments.go @@ -53,7 +53,7 @@ func NewListEnrollments(ctx *middleware.Context, handler ListEnrollmentsHandler) return &ListEnrollments{Context: ctx, Handler: handler} } -/*ListEnrollments swagger:route GET /enrollments Enrollment listEnrollments +/* ListEnrollments swagger:route GET /enrollments Enrollment listEnrollments List outstanding enrollments @@ -69,21 +69,20 @@ type ListEnrollments struct { func (o *ListEnrollments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEnrollments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/enrollment/list_enrollments_parameters.go b/rest_management_api_server/operations/enrollment/list_enrollments_parameters.go similarity index 98% rename from rest_server/operations/enrollment/list_enrollments_parameters.go rename to rest_management_api_server/operations/enrollment/list_enrollments_parameters.go index 7ecc08bf9..c7364b03d 100644 --- a/rest_server/operations/enrollment/list_enrollments_parameters.go +++ b/rest_management_api_server/operations/enrollment/list_enrollments_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListEnrollmentsParams creates a new ListEnrollmentsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEnrollmentsParams() ListEnrollmentsParams { return ListEnrollmentsParams{} @@ -94,7 +95,6 @@ func (o *ListEnrollmentsParams) BindRequest(r *http.Request, route *middleware.M if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListEnrollmentsParams) bindFilter(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListEnrollmentsParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListEnrollmentsParams) bindOffset(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/enrollment/list_enrollments_responses.go b/rest_management_api_server/operations/enrollment/list_enrollments_responses.go similarity index 100% rename from rest_server/operations/enrollment/list_enrollments_responses.go rename to rest_management_api_server/operations/enrollment/list_enrollments_responses.go diff --git a/rest_server/operations/enrollment/list_enrollments_urlbuilder.go b/rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go similarity index 99% rename from rest_server/operations/enrollment/list_enrollments_urlbuilder.go rename to rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go index 827f58a26..e2d0f79f4 100644 --- a/rest_server/operations/enrollment/list_enrollments_urlbuilder.go +++ b/rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListEnrollmentsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/associate_identitys_service_configs.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs.go similarity index 93% rename from rest_server/operations/identity/associate_identitys_service_configs.go rename to rest_management_api_server/operations/identity/associate_identitys_service_configs.go index e1d4946e5..797ab1738 100644 --- a/rest_server/operations/identity/associate_identitys_service_configs.go +++ b/rest_management_api_server/operations/identity/associate_identitys_service_configs.go @@ -53,7 +53,7 @@ func NewAssociateIdentitysServiceConfigs(ctx *middleware.Context, handler Associ return &AssociateIdentitysServiceConfigs{Context: ctx, Handler: handler} } -/*AssociateIdentitysServiceConfigs swagger:route POST /identities/{id}/service-configs Identity associateIdentitysServiceConfigs +/* AssociateIdentitysServiceConfigs swagger:route POST /identities/{id}/service-configs Identity associateIdentitysServiceConfigs Associate service configs for a specific identity @@ -68,21 +68,20 @@ type AssociateIdentitysServiceConfigs struct { func (o *AssociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *AssociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r * } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/associate_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go similarity index 93% rename from rest_server/operations/identity/associate_identitys_service_configs_parameters.go rename to rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go index 3c154b187..d33227175 100644 --- a/rest_server/operations/identity/associate_identitys_service_configs_parameters.go +++ b/rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go @@ -30,6 +30,7 @@ package identity // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewAssociateIdentitysServiceConfigsParams() AssociateIdentitysServiceConfigsParams { return AssociateIdentitysServiceConfigsParams{} @@ -98,6 +101,11 @@ func (o *AssociateIdentitysServiceConfigsParams) BindRequest(r *http.Request, ro 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 } @@ -120,7 +128,6 @@ func (o *AssociateIdentitysServiceConfigsParams) bindID(rawData []string, hasKey // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/associate_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_responses.go similarity index 100% rename from rest_server/operations/identity/associate_identitys_service_configs_responses.go rename to rest_management_api_server/operations/identity/associate_identitys_service_configs_responses.go diff --git a/rest_server/operations/identity/associate_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/associate_identitys_service_configs_urlbuilder.go rename to rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go index 5d66fc2fa..a3ed87ae2 100644 --- a/rest_server/operations/identity/associate_identitys_service_configs_urlbuilder.go +++ b/rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go @@ -75,7 +75,7 @@ func (o *AssociateIdentitysServiceConfigsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/create_identity.go b/rest_management_api_server/operations/identity/create_identity.go similarity index 94% rename from rest_server/operations/identity/create_identity.go rename to rest_management_api_server/operations/identity/create_identity.go index 95d5f4b04..fadf0da61 100644 --- a/rest_server/operations/identity/create_identity.go +++ b/rest_management_api_server/operations/identity/create_identity.go @@ -53,7 +53,7 @@ func NewCreateIdentity(ctx *middleware.Context, handler CreateIdentityHandler) * return &CreateIdentity{Context: ctx, Handler: handler} } -/*CreateIdentity swagger:route POST /identities Identity createIdentity +/* CreateIdentity swagger:route POST /identities Identity createIdentity Create an identity resource @@ -68,21 +68,20 @@ type CreateIdentity struct { func (o *CreateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/create_identity_parameters.go b/rest_management_api_server/operations/identity/create_identity_parameters.go similarity index 91% rename from rest_server/operations/identity/create_identity_parameters.go rename to rest_management_api_server/operations/identity/create_identity_parameters.go index 9b30434d5..84655840a 100644 --- a/rest_server/operations/identity/create_identity_parameters.go +++ b/rest_management_api_server/operations/identity/create_identity_parameters.go @@ -30,18 +30,21 @@ package identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateIdentityParams() CreateIdentityParams { return CreateIdentityParams{} @@ -87,6 +90,11 @@ func (o *CreateIdentityParams) BindRequest(r *http.Request, route *middleware.Ma 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 } diff --git a/rest_server/operations/identity/create_identity_responses.go b/rest_management_api_server/operations/identity/create_identity_responses.go similarity index 100% rename from rest_server/operations/identity/create_identity_responses.go rename to rest_management_api_server/operations/identity/create_identity_responses.go diff --git a/rest_server/operations/identity/create_identity_urlbuilder.go b/rest_management_api_server/operations/identity/create_identity_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/create_identity_urlbuilder.go rename to rest_management_api_server/operations/identity/create_identity_urlbuilder.go index 03a4ccfbb..4e913d7fc 100644 --- a/rest_server/operations/identity/create_identity_urlbuilder.go +++ b/rest_management_api_server/operations/identity/create_identity_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/delete_identity.go b/rest_management_api_server/operations/identity/delete_identity.go similarity index 94% rename from rest_server/operations/identity/delete_identity.go rename to rest_management_api_server/operations/identity/delete_identity.go index 4a8d72a92..1bcd33644 100644 --- a/rest_server/operations/identity/delete_identity.go +++ b/rest_management_api_server/operations/identity/delete_identity.go @@ -53,7 +53,7 @@ func NewDeleteIdentity(ctx *middleware.Context, handler DeleteIdentityHandler) * return &DeleteIdentity{Context: ctx, Handler: handler} } -/*DeleteIdentity swagger:route DELETE /identities/{id} Identity deleteIdentity +/* DeleteIdentity swagger:route DELETE /identities/{id} Identity deleteIdentity Delete an identity @@ -68,21 +68,20 @@ type DeleteIdentity struct { func (o *DeleteIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/delete_identity_parameters.go b/rest_management_api_server/operations/identity/delete_identity_parameters.go similarity index 98% rename from rest_server/operations/identity/delete_identity_parameters.go rename to rest_management_api_server/operations/identity/delete_identity_parameters.go index 3f42d9a1d..41002978e 100644 --- a/rest_server/operations/identity/delete_identity_parameters.go +++ b/rest_management_api_server/operations/identity/delete_identity_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteIdentityParams creates a new DeleteIdentityParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteIdentityParams() DeleteIdentityParams { return DeleteIdentityParams{} @@ -73,7 +74,6 @@ func (o *DeleteIdentityParams) BindRequest(r *http.Request, route *middleware.Ma if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteIdentityParams) bindID(rawData []string, hasKey bool, formats str // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/delete_identity_responses.go b/rest_management_api_server/operations/identity/delete_identity_responses.go similarity index 100% rename from rest_server/operations/identity/delete_identity_responses.go rename to rest_management_api_server/operations/identity/delete_identity_responses.go diff --git a/rest_server/operations/identity/delete_identity_urlbuilder.go b/rest_management_api_server/operations/identity/delete_identity_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/delete_identity_urlbuilder.go rename to rest_management_api_server/operations/identity/delete_identity_urlbuilder.go index 71e2ecc42..0da1de8d8 100644 --- a/rest_server/operations/identity/delete_identity_urlbuilder.go +++ b/rest_management_api_server/operations/identity/delete_identity_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/detail_identity.go b/rest_management_api_server/operations/identity/detail_identity.go similarity index 94% rename from rest_server/operations/identity/detail_identity.go rename to rest_management_api_server/operations/identity/detail_identity.go index e9a06fc39..24ab4bbff 100644 --- a/rest_server/operations/identity/detail_identity.go +++ b/rest_management_api_server/operations/identity/detail_identity.go @@ -53,7 +53,7 @@ func NewDetailIdentity(ctx *middleware.Context, handler DetailIdentityHandler) * return &DetailIdentity{Context: ctx, Handler: handler} } -/*DetailIdentity swagger:route GET /identities/{id} Identity detailIdentity +/* DetailIdentity swagger:route GET /identities/{id} Identity detailIdentity Retrieves a single identity @@ -68,21 +68,20 @@ type DetailIdentity struct { func (o *DetailIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/detail_identity_parameters.go b/rest_management_api_server/operations/identity/detail_identity_parameters.go similarity index 98% rename from rest_server/operations/identity/detail_identity_parameters.go rename to rest_management_api_server/operations/identity/detail_identity_parameters.go index 9bda3cd88..8453776ab 100644 --- a/rest_server/operations/identity/detail_identity_parameters.go +++ b/rest_management_api_server/operations/identity/detail_identity_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailIdentityParams creates a new DetailIdentityParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailIdentityParams() DetailIdentityParams { return DetailIdentityParams{} @@ -73,7 +74,6 @@ func (o *DetailIdentityParams) BindRequest(r *http.Request, route *middleware.Ma if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailIdentityParams) bindID(rawData []string, hasKey bool, formats str // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/detail_identity_responses.go b/rest_management_api_server/operations/identity/detail_identity_responses.go similarity index 100% rename from rest_server/operations/identity/detail_identity_responses.go rename to rest_management_api_server/operations/identity/detail_identity_responses.go diff --git a/rest_server/operations/identity/detail_identity_type.go b/rest_management_api_server/operations/identity/detail_identity_type.go similarity index 93% rename from rest_server/operations/identity/detail_identity_type.go rename to rest_management_api_server/operations/identity/detail_identity_type.go index 6dc29d25c..74f5d1615 100644 --- a/rest_server/operations/identity/detail_identity_type.go +++ b/rest_management_api_server/operations/identity/detail_identity_type.go @@ -53,7 +53,7 @@ func NewDetailIdentityType(ctx *middleware.Context, handler DetailIdentityTypeHa return &DetailIdentityType{Context: ctx, Handler: handler} } -/*DetailIdentityType swagger:route GET /identity-types/{id} Identity detailIdentityType +/* DetailIdentityType swagger:route GET /identity-types/{id} Identity detailIdentityType Retrieves a identity type @@ -68,21 +68,20 @@ type DetailIdentityType struct { func (o *DetailIdentityType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailIdentityType) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/detail_identity_type_parameters.go b/rest_management_api_server/operations/identity/detail_identity_type_parameters.go similarity index 98% rename from rest_server/operations/identity/detail_identity_type_parameters.go rename to rest_management_api_server/operations/identity/detail_identity_type_parameters.go index 4c42fa50a..2c84b7b1c 100644 --- a/rest_server/operations/identity/detail_identity_type_parameters.go +++ b/rest_management_api_server/operations/identity/detail_identity_type_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailIdentityTypeParams creates a new DetailIdentityTypeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailIdentityTypeParams() DetailIdentityTypeParams { return DetailIdentityTypeParams{} @@ -73,7 +74,6 @@ func (o *DetailIdentityTypeParams) BindRequest(r *http.Request, route *middlewar if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailIdentityTypeParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/detail_identity_type_responses.go b/rest_management_api_server/operations/identity/detail_identity_type_responses.go similarity index 100% rename from rest_server/operations/identity/detail_identity_type_responses.go rename to rest_management_api_server/operations/identity/detail_identity_type_responses.go diff --git a/rest_server/operations/identity/detail_identity_type_urlbuilder.go b/rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/detail_identity_type_urlbuilder.go rename to rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go index 7e796fc6b..ec75b190c 100644 --- a/rest_server/operations/identity/detail_identity_type_urlbuilder.go +++ b/rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailIdentityTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/detail_identity_urlbuilder.go b/rest_management_api_server/operations/identity/detail_identity_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/detail_identity_urlbuilder.go rename to rest_management_api_server/operations/identity/detail_identity_urlbuilder.go index 34b73a7aa..2dac415e3 100644 --- a/rest_server/operations/identity/detail_identity_urlbuilder.go +++ b/rest_management_api_server/operations/identity/detail_identity_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/disassociate_identitys_service_configs.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go similarity index 93% rename from rest_server/operations/identity/disassociate_identitys_service_configs.go rename to rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go index 8438de15f..3367e13e7 100644 --- a/rest_server/operations/identity/disassociate_identitys_service_configs.go +++ b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go @@ -53,7 +53,7 @@ func NewDisassociateIdentitysServiceConfigs(ctx *middleware.Context, handler Dis return &DisassociateIdentitysServiceConfigs{Context: ctx, Handler: handler} } -/*DisassociateIdentitysServiceConfigs swagger:route DELETE /identities/{id}/service-configs Identity disassociateIdentitysServiceConfigs +/* DisassociateIdentitysServiceConfigs swagger:route DELETE /identities/{id}/service-configs Identity disassociateIdentitysServiceConfigs Remove associated service configs from a specific identity @@ -68,21 +68,20 @@ type DisassociateIdentitysServiceConfigs struct { func (o *DisassociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DisassociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/disassociate_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go similarity index 93% rename from rest_server/operations/identity/disassociate_identitys_service_configs_parameters.go rename to rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go index a65301667..28840445e 100644 --- a/rest_server/operations/identity/disassociate_identitys_service_configs_parameters.go +++ b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go @@ -30,18 +30,21 @@ package identity // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDisassociateIdentitysServiceConfigsParams() DisassociateIdentitysServiceConfigsParams { return DisassociateIdentitysServiceConfigsParams{} @@ -92,6 +95,11 @@ func (o *DisassociateIdentitysServiceConfigsParams) BindRequest(r *http.Request, 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 } @@ -112,7 +120,6 @@ func (o *DisassociateIdentitysServiceConfigsParams) bindID(rawData []string, has // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/disassociate_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_responses.go similarity index 100% rename from rest_server/operations/identity/disassociate_identitys_service_configs_responses.go rename to rest_management_api_server/operations/identity/disassociate_identitys_service_configs_responses.go diff --git a/rest_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go rename to rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go index 8acd5ae9e..7d34c17aa 100644 --- a/rest_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go +++ b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DisassociateIdentitysServiceConfigsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/get_identity_failed_service_requests.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests.go similarity index 93% rename from rest_server/operations/identity/get_identity_failed_service_requests.go rename to rest_management_api_server/operations/identity/get_identity_failed_service_requests.go index 6ef38ad56..2708ec6f7 100644 --- a/rest_server/operations/identity/get_identity_failed_service_requests.go +++ b/rest_management_api_server/operations/identity/get_identity_failed_service_requests.go @@ -53,7 +53,7 @@ func NewGetIdentityFailedServiceRequests(ctx *middleware.Context, handler GetIde return &GetIdentityFailedServiceRequests{Context: ctx, Handler: handler} } -/*GetIdentityFailedServiceRequests swagger:route GET /identities/{id}/failed-service-requests Identity getIdentityFailedServiceRequests +/* 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 @@ -71,21 +71,20 @@ type GetIdentityFailedServiceRequests struct { func (o *GetIdentityFailedServiceRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -94,7 +93,6 @@ func (o *GetIdentityFailedServiceRequests) ServeHTTP(rw http.ResponseWriter, r * } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/get_identity_failed_service_requests_parameters.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go similarity index 98% rename from rest_server/operations/identity/get_identity_failed_service_requests_parameters.go rename to rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go index d0832fb75..f6923bdfe 100644 --- a/rest_server/operations/identity/get_identity_failed_service_requests_parameters.go +++ b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewGetIdentityFailedServiceRequestsParams creates a new GetIdentityFailedServiceRequestsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetIdentityFailedServiceRequestsParams() GetIdentityFailedServiceRequestsParams { return GetIdentityFailedServiceRequestsParams{} @@ -73,7 +74,6 @@ func (o *GetIdentityFailedServiceRequestsParams) BindRequest(r *http.Request, ro if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *GetIdentityFailedServiceRequestsParams) bindID(rawData []string, hasKey // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/get_identity_failed_service_requests_responses.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go similarity index 96% rename from rest_server/operations/identity/get_identity_failed_service_requests_responses.go rename to rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go index bc7739b26..dfc8ac36d 100644 --- a/rest_server/operations/identity/get_identity_failed_service_requests_responses.go +++ b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go @@ -49,7 +49,7 @@ type GetIdentityFailedServiceRequestsOK struct { /* In: Body */ - Payload *rest_model.GetIdentityFailedServiceRequestEnvelope `json:"body,omitempty"` + Payload *rest_model.FailedServiceRequestEnvelope `json:"body,omitempty"` } // NewGetIdentityFailedServiceRequestsOK creates GetIdentityFailedServiceRequestsOK with default headers values @@ -59,13 +59,13 @@ func NewGetIdentityFailedServiceRequestsOK() *GetIdentityFailedServiceRequestsOK } // WithPayload adds the payload to the get identity failed service requests o k response -func (o *GetIdentityFailedServiceRequestsOK) WithPayload(payload *rest_model.GetIdentityFailedServiceRequestEnvelope) *GetIdentityFailedServiceRequestsOK { +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.GetIdentityFailedServiceRequestEnvelope) { +func (o *GetIdentityFailedServiceRequestsOK) SetPayload(payload *rest_model.FailedServiceRequestEnvelope) { o.Payload = payload } diff --git a/rest_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go rename to rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go index 87fd7ad22..11b2a7cf5 100644 --- a/rest_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go +++ b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go @@ -75,7 +75,7 @@ func (o *GetIdentityFailedServiceRequestsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/get_identity_policy_advice.go b/rest_management_api_server/operations/identity/get_identity_policy_advice.go similarity index 93% rename from rest_server/operations/identity/get_identity_policy_advice.go rename to rest_management_api_server/operations/identity/get_identity_policy_advice.go index 8dc1e789f..3fac30f63 100644 --- a/rest_server/operations/identity/get_identity_policy_advice.go +++ b/rest_management_api_server/operations/identity/get_identity_policy_advice.go @@ -53,7 +53,7 @@ func NewGetIdentityPolicyAdvice(ctx *middleware.Context, handler GetIdentityPoli return &GetIdentityPolicyAdvice{Context: ctx, Handler: handler} } -/*GetIdentityPolicyAdvice swagger:route GET /identities/{id}/policy-advice/{serviceId} Identity getIdentityPolicyAdvice +/* GetIdentityPolicyAdvice swagger:route GET /identities/{id}/policy-advice/{serviceId} Identity getIdentityPolicyAdvice Analyze policies relating the given identity and service @@ -72,21 +72,20 @@ type GetIdentityPolicyAdvice struct { func (o *GetIdentityPolicyAdvice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -95,7 +94,6 @@ func (o *GetIdentityPolicyAdvice) ServeHTTP(rw http.ResponseWriter, r *http.Requ } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/get_identity_policy_advice_parameters.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go similarity index 98% rename from rest_server/operations/identity/get_identity_policy_advice_parameters.go rename to rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go index c4ebc7ee8..f650190eb 100644 --- a/rest_server/operations/identity/get_identity_policy_advice_parameters.go +++ b/rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewGetIdentityPolicyAdviceParams creates a new GetIdentityPolicyAdviceParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetIdentityPolicyAdviceParams() GetIdentityPolicyAdviceParams { return GetIdentityPolicyAdviceParams{} @@ -83,7 +84,6 @@ func (o *GetIdentityPolicyAdviceParams) BindRequest(r *http.Request, route *midd if err := o.bindServiceID(rServiceID, rhkServiceID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -99,7 +99,6 @@ func (o *GetIdentityPolicyAdviceParams) bindID(rawData []string, hasKey bool, fo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -114,7 +113,6 @@ func (o *GetIdentityPolicyAdviceParams) bindServiceID(rawData []string, hasKey b // Required: true // Parameter is provided by construction from the route - o.ServiceID = raw return nil diff --git a/rest_server/operations/identity/get_identity_policy_advice_responses.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_responses.go similarity index 100% rename from rest_server/operations/identity/get_identity_policy_advice_responses.go rename to rest_management_api_server/operations/identity/get_identity_policy_advice_responses.go diff --git a/rest_server/operations/identity/get_identity_policy_advice_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/get_identity_policy_advice_urlbuilder.go rename to rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go index a156a9e51..32ccf89e6 100644 --- a/rest_server/operations/identity/get_identity_policy_advice_urlbuilder.go +++ b/rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go @@ -83,7 +83,7 @@ func (o *GetIdentityPolicyAdviceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/get_identity_posture_data.go b/rest_management_api_server/operations/identity/get_identity_posture_data.go similarity index 93% rename from rest_server/operations/identity/get_identity_posture_data.go rename to rest_management_api_server/operations/identity/get_identity_posture_data.go index 3a63aac1c..249583005 100644 --- a/rest_server/operations/identity/get_identity_posture_data.go +++ b/rest_management_api_server/operations/identity/get_identity_posture_data.go @@ -53,7 +53,7 @@ func NewGetIdentityPostureData(ctx *middleware.Context, handler GetIdentityPostu return &GetIdentityPostureData{Context: ctx, Handler: handler} } -/*GetIdentityPostureData swagger:route GET /identities/{id}/posture-data Identity getIdentityPostureData +/* GetIdentityPostureData swagger:route GET /identities/{id}/posture-data Identity getIdentityPostureData Retrieve the curent posture data for a specific identity. @@ -70,21 +70,20 @@ type GetIdentityPostureData struct { func (o *GetIdentityPostureData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -93,7 +92,6 @@ func (o *GetIdentityPostureData) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/get_identity_posture_data_parameters.go b/rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go similarity index 98% rename from rest_server/operations/identity/get_identity_posture_data_parameters.go rename to rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go index 7e24cd5f9..13d15b80b 100644 --- a/rest_server/operations/identity/get_identity_posture_data_parameters.go +++ b/rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewGetIdentityPostureDataParams creates a new GetIdentityPostureDataParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewGetIdentityPostureDataParams() GetIdentityPostureDataParams { return GetIdentityPostureDataParams{} @@ -73,7 +74,6 @@ func (o *GetIdentityPostureDataParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *GetIdentityPostureDataParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/get_identity_posture_data_responses.go b/rest_management_api_server/operations/identity/get_identity_posture_data_responses.go similarity index 96% rename from rest_server/operations/identity/get_identity_posture_data_responses.go rename to rest_management_api_server/operations/identity/get_identity_posture_data_responses.go index e2e5e7339..aa16d9559 100644 --- a/rest_server/operations/identity/get_identity_posture_data_responses.go +++ b/rest_management_api_server/operations/identity/get_identity_posture_data_responses.go @@ -49,7 +49,7 @@ type GetIdentityPostureDataOK struct { /* In: Body */ - Payload *rest_model.GetIdentityPostureDataEnvelope `json:"body,omitempty"` + Payload *rest_model.PostureDataEnvelope `json:"body,omitempty"` } // NewGetIdentityPostureDataOK creates GetIdentityPostureDataOK with default headers values @@ -59,13 +59,13 @@ func NewGetIdentityPostureDataOK() *GetIdentityPostureDataOK { } // WithPayload adds the payload to the get identity posture data o k response -func (o *GetIdentityPostureDataOK) WithPayload(payload *rest_model.GetIdentityPostureDataEnvelope) *GetIdentityPostureDataOK { +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.GetIdentityPostureDataEnvelope) { +func (o *GetIdentityPostureDataOK) SetPayload(payload *rest_model.PostureDataEnvelope) { o.Payload = payload } diff --git a/rest_server/operations/identity/get_identity_posture_data_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/get_identity_posture_data_urlbuilder.go rename to rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go index 1f2efc173..ec69b6806 100644 --- a/rest_server/operations/identity/get_identity_posture_data_urlbuilder.go +++ b/rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go @@ -75,7 +75,7 @@ func (o *GetIdentityPostureDataURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identities.go b/rest_management_api_server/operations/identity/list_identities.go similarity index 94% rename from rest_server/operations/identity/list_identities.go rename to rest_management_api_server/operations/identity/list_identities.go index cf0073f22..d09016ced 100644 --- a/rest_server/operations/identity/list_identities.go +++ b/rest_management_api_server/operations/identity/list_identities.go @@ -53,7 +53,7 @@ func NewListIdentities(ctx *middleware.Context, handler ListIdentitiesHandler) * return &ListIdentities{Context: ctx, Handler: handler} } -/*ListIdentities swagger:route GET /identities Identity listIdentities +/* ListIdentities swagger:route GET /identities Identity listIdentities List identities @@ -69,21 +69,20 @@ type ListIdentities struct { func (o *ListIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identities_parameters.go b/rest_management_api_server/operations/identity/list_identities_parameters.go similarity index 99% rename from rest_server/operations/identity/list_identities_parameters.go rename to rest_management_api_server/operations/identity/list_identities_parameters.go index 88d3f3b95..4136f4a20 100644 --- a/rest_server/operations/identity/list_identities_parameters.go +++ b/rest_management_api_server/operations/identity/list_identities_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListIdentitiesParams creates a new ListIdentitiesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentitiesParams() ListIdentitiesParams { return ListIdentitiesParams{} @@ -113,7 +114,6 @@ func (o *ListIdentitiesParams) BindRequest(r *http.Request, route *middleware.Ma if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -129,10 +129,10 @@ func (o *ListIdentitiesParams) bindFilter(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -147,6 +147,7 @@ func (o *ListIdentitiesParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -169,6 +170,7 @@ func (o *ListIdentitiesParams) bindOffset(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -186,10 +188,8 @@ func (o *ListIdentitiesParams) bindOffset(rawData []string, hasKey bool, formats // // 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 } @@ -215,10 +215,10 @@ func (o *ListIdentitiesParams) bindRoleSemantic(rawData []string, hasKey bool, f // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.RoleSemantic = &raw return nil diff --git a/rest_server/operations/identity/list_identities_responses.go b/rest_management_api_server/operations/identity/list_identities_responses.go similarity index 100% rename from rest_server/operations/identity/list_identities_responses.go rename to rest_management_api_server/operations/identity/list_identities_responses.go diff --git a/rest_server/operations/identity/list_identities_urlbuilder.go b/rest_management_api_server/operations/identity/list_identities_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identities_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identities_urlbuilder.go index 49c7e2936..0dc1de20d 100644 --- a/rest_server/operations/identity/list_identities_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identities_urlbuilder.go @@ -73,7 +73,7 @@ func (o *ListIdentitiesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identity_edge_routers.go b/rest_management_api_server/operations/identity/list_identity_edge_routers.go similarity index 93% rename from rest_server/operations/identity/list_identity_edge_routers.go rename to rest_management_api_server/operations/identity/list_identity_edge_routers.go index 3565eb98c..701f604dc 100644 --- a/rest_server/operations/identity/list_identity_edge_routers.go +++ b/rest_management_api_server/operations/identity/list_identity_edge_routers.go @@ -53,7 +53,7 @@ func NewListIdentityEdgeRouters(ctx *middleware.Context, handler ListIdentityEdg return &ListIdentityEdgeRouters{Context: ctx, Handler: handler} } -/*ListIdentityEdgeRouters swagger:route GET /identities/{id}/edge-routers Identity listIdentityEdgeRouters +/* ListIdentityEdgeRouters swagger:route GET /identities/{id}/edge-routers Identity listIdentityEdgeRouters List accessible edge-routers @@ -69,21 +69,20 @@ type ListIdentityEdgeRouters struct { func (o *ListIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Requ } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identity_edge_routers_parameters.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identity_edge_routers_parameters.go rename to rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go index 2edce01f8..61a34a891 100644 --- a/rest_server/operations/identity/list_identity_edge_routers_parameters.go +++ b/rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListIdentityEdgeRoutersParams creates a new ListIdentityEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentityEdgeRoutersParams() ListIdentityEdgeRoutersParams { return ListIdentityEdgeRoutersParams{} @@ -73,7 +74,6 @@ func (o *ListIdentityEdgeRoutersParams) BindRequest(r *http.Request, route *midd if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListIdentityEdgeRoutersParams) bindID(rawData []string, hasKey bool, fo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/list_identity_edge_routers_responses.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_responses.go similarity index 100% rename from rest_server/operations/identity/list_identity_edge_routers_responses.go rename to rest_management_api_server/operations/identity/list_identity_edge_routers_responses.go diff --git a/rest_server/operations/identity/list_identity_edge_routers_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identity_edge_routers_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go index cd5c7ce1c..421e87556 100644 --- a/rest_server/operations/identity/list_identity_edge_routers_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListIdentityEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identity_service_policies.go b/rest_management_api_server/operations/identity/list_identity_service_policies.go similarity index 93% rename from rest_server/operations/identity/list_identity_service_policies.go rename to rest_management_api_server/operations/identity/list_identity_service_policies.go index 02eab4f89..8bf016780 100644 --- a/rest_server/operations/identity/list_identity_service_policies.go +++ b/rest_management_api_server/operations/identity/list_identity_service_policies.go @@ -53,7 +53,7 @@ func NewListIdentityServicePolicies(ctx *middleware.Context, handler ListIdentit return &ListIdentityServicePolicies{Context: ctx, Handler: handler} } -/*ListIdentityServicePolicies swagger:route GET /identities/{id}/service-policies Identity listIdentityServicePolicies +/* ListIdentityServicePolicies swagger:route GET /identities/{id}/service-policies Identity listIdentityServicePolicies List the service policies that affect an identity @@ -68,21 +68,20 @@ type ListIdentityServicePolicies struct { func (o *ListIdentityServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListIdentityServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http. } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identity_service_policies_parameters.go b/rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identity_service_policies_parameters.go rename to rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go index fd7321dc2..c206a0a13 100644 --- a/rest_server/operations/identity/list_identity_service_policies_parameters.go +++ b/rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListIdentityServicePoliciesParams creates a new ListIdentityServicePoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentityServicePoliciesParams() ListIdentityServicePoliciesParams { return ListIdentityServicePoliciesParams{} @@ -73,7 +74,6 @@ func (o *ListIdentityServicePoliciesParams) BindRequest(r *http.Request, route * if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListIdentityServicePoliciesParams) bindID(rawData []string, hasKey bool // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/list_identity_service_policies_responses.go b/rest_management_api_server/operations/identity/list_identity_service_policies_responses.go similarity index 100% rename from rest_server/operations/identity/list_identity_service_policies_responses.go rename to rest_management_api_server/operations/identity/list_identity_service_policies_responses.go diff --git a/rest_server/operations/identity/list_identity_service_policies_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identity_service_policies_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go index 6e4969fe1..6c0055288 100644 --- a/rest_server/operations/identity/list_identity_service_policies_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListIdentityServicePoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identity_services.go b/rest_management_api_server/operations/identity/list_identity_services.go similarity index 93% rename from rest_server/operations/identity/list_identity_services.go rename to rest_management_api_server/operations/identity/list_identity_services.go index 310fb10f0..e22d8ae6e 100644 --- a/rest_server/operations/identity/list_identity_services.go +++ b/rest_management_api_server/operations/identity/list_identity_services.go @@ -53,7 +53,7 @@ func NewListIdentityServices(ctx *middleware.Context, handler ListIdentityServic return &ListIdentityServices{Context: ctx, Handler: handler} } -/*ListIdentityServices swagger:route GET /identities/{id}/services Identity listIdentityServices +/* ListIdentityServices swagger:route GET /identities/{id}/services Identity listIdentityServices List accessible services @@ -69,21 +69,20 @@ type ListIdentityServices struct { func (o *ListIdentityServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListIdentityServices) ServeHTTP(rw http.ResponseWriter, r *http.Request } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identity_services_parameters.go b/rest_management_api_server/operations/identity/list_identity_services_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identity_services_parameters.go rename to rest_management_api_server/operations/identity/list_identity_services_parameters.go index 1ead0605f..9c953d3b2 100644 --- a/rest_server/operations/identity/list_identity_services_parameters.go +++ b/rest_management_api_server/operations/identity/list_identity_services_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListIdentityServicesParams creates a new ListIdentityServicesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentityServicesParams() ListIdentityServicesParams { return ListIdentityServicesParams{} @@ -73,7 +74,6 @@ func (o *ListIdentityServicesParams) BindRequest(r *http.Request, route *middlew if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListIdentityServicesParams) bindID(rawData []string, hasKey bool, forma // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/list_identity_services_responses.go b/rest_management_api_server/operations/identity/list_identity_services_responses.go similarity index 100% rename from rest_server/operations/identity/list_identity_services_responses.go rename to rest_management_api_server/operations/identity/list_identity_services_responses.go diff --git a/rest_server/operations/identity/list_identity_services_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identity_services_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go index 6554bf342..2042e3199 100644 --- a/rest_server/operations/identity/list_identity_services_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListIdentityServicesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identity_types.go b/rest_management_api_server/operations/identity/list_identity_types.go similarity index 94% rename from rest_server/operations/identity/list_identity_types.go rename to rest_management_api_server/operations/identity/list_identity_types.go index 1693fd0e1..dcb6eff21 100644 --- a/rest_server/operations/identity/list_identity_types.go +++ b/rest_management_api_server/operations/identity/list_identity_types.go @@ -53,7 +53,7 @@ func NewListIdentityTypes(ctx *middleware.Context, handler ListIdentityTypesHand return &ListIdentityTypes{Context: ctx, Handler: handler} } -/*ListIdentityTypes swagger:route GET /identity-types Identity listIdentityTypes +/* ListIdentityTypes swagger:route GET /identity-types Identity listIdentityTypes List available identity types @@ -69,21 +69,20 @@ type ListIdentityTypes struct { func (o *ListIdentityTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListIdentityTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identity_types_parameters.go b/rest_management_api_server/operations/identity/list_identity_types_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identity_types_parameters.go rename to rest_management_api_server/operations/identity/list_identity_types_parameters.go index 1deafa420..20f5edb2e 100644 --- a/rest_server/operations/identity/list_identity_types_parameters.go +++ b/rest_management_api_server/operations/identity/list_identity_types_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListIdentityTypesParams creates a new ListIdentityTypesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentityTypesParams() ListIdentityTypesParams { return ListIdentityTypesParams{} @@ -94,7 +95,6 @@ func (o *ListIdentityTypesParams) BindRequest(r *http.Request, route *middleware if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListIdentityTypesParams) bindFilter(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListIdentityTypesParams) bindLimit(rawData []string, hasKey bool, forma // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListIdentityTypesParams) bindOffset(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/identity/list_identity_types_responses.go b/rest_management_api_server/operations/identity/list_identity_types_responses.go similarity index 100% rename from rest_server/operations/identity/list_identity_types_responses.go rename to rest_management_api_server/operations/identity/list_identity_types_responses.go diff --git a/rest_server/operations/identity/list_identity_types_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identity_types_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go index eec05eac8..928f188d7 100644 --- a/rest_server/operations/identity/list_identity_types_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListIdentityTypesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identitys_edge_router_policies.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go similarity index 91% rename from rest_server/operations/identity/list_identitys_edge_router_policies.go rename to rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go index 5f9b0cfd9..d77549e93 100644 --- a/rest_server/operations/identity/list_identitys_edge_router_policies.go +++ b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go @@ -53,9 +53,9 @@ func NewListIdentitysEdgeRouterPolicies(ctx *middleware.Context, handler ListIde return &ListIdentitysEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListIdentitysEdgeRouterPolicies swagger:route GET /identities/{id}/edge-router-policies Identity listIdentitysEdgeRouterPolicies +/* ListIdentitysEdgeRouterPolicies swagger:route GET /identities/{id}/edge-router-policies Identity listIdentitysEdgeRouterPolicies -List the edge router policies that affect an idenitty +List the edge router policies that affect an identity Retrieves a list of edge router policies that apply to the specified identity. @@ -68,21 +68,20 @@ type ListIdentitysEdgeRouterPolicies struct { func (o *ListIdentitysEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListIdentitysEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *h } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identitys_edge_router_policies_parameters.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identitys_edge_router_policies_parameters.go rename to rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go index 59ed20769..ca77f708d 100644 --- a/rest_server/operations/identity/list_identitys_edge_router_policies_parameters.go +++ b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListIdentitysEdgeRouterPoliciesParams creates a new ListIdentitysEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentitysEdgeRouterPoliciesParams() ListIdentitysEdgeRouterPoliciesParams { return ListIdentitysEdgeRouterPoliciesParams{} @@ -73,7 +74,6 @@ func (o *ListIdentitysEdgeRouterPoliciesParams) BindRequest(r *http.Request, rou if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListIdentitysEdgeRouterPoliciesParams) bindID(rawData []string, hasKey // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/list_identitys_edge_router_policies_responses.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_responses.go similarity index 100% rename from rest_server/operations/identity/list_identitys_edge_router_policies_responses.go rename to rest_management_api_server/operations/identity/list_identitys_edge_router_policies_responses.go diff --git a/rest_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go index 9e90a2842..9af1749df 100644 --- a/rest_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListIdentitysEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/list_identitys_service_configs.go b/rest_management_api_server/operations/identity/list_identitys_service_configs.go similarity index 93% rename from rest_server/operations/identity/list_identitys_service_configs.go rename to rest_management_api_server/operations/identity/list_identitys_service_configs.go index 686f5a8ee..d65536fb4 100644 --- a/rest_server/operations/identity/list_identitys_service_configs.go +++ b/rest_management_api_server/operations/identity/list_identitys_service_configs.go @@ -53,7 +53,7 @@ func NewListIdentitysServiceConfigs(ctx *middleware.Context, handler ListIdentit return &ListIdentitysServiceConfigs{Context: ctx, Handler: handler} } -/*ListIdentitysServiceConfigs swagger:route GET /identities/{id}/service-configs Identity listIdentitysServiceConfigs +/* ListIdentitysServiceConfigs swagger:route GET /identities/{id}/service-configs Identity listIdentitysServiceConfigs List the service configs associated a specific identity @@ -68,21 +68,20 @@ type ListIdentitysServiceConfigs struct { func (o *ListIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http. } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/list_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go similarity index 98% rename from rest_server/operations/identity/list_identitys_service_configs_parameters.go rename to rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go index 59e65725f..7bbba6242 100644 --- a/rest_server/operations/identity/list_identitys_service_configs_parameters.go +++ b/rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewListIdentitysServiceConfigsParams creates a new ListIdentitysServiceConfigsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentitysServiceConfigsParams() ListIdentitysServiceConfigsParams { return ListIdentitysServiceConfigsParams{} @@ -73,7 +74,6 @@ func (o *ListIdentitysServiceConfigsParams) BindRequest(r *http.Request, route * if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListIdentitysServiceConfigsParams) bindID(rawData []string, hasKey bool // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/list_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_responses.go similarity index 100% rename from rest_server/operations/identity/list_identitys_service_configs_responses.go rename to rest_management_api_server/operations/identity/list_identitys_service_configs_responses.go diff --git a/rest_server/operations/identity/list_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go similarity index 99% rename from rest_server/operations/identity/list_identitys_service_configs_urlbuilder.go rename to rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go index ba0c6754a..13bd9c8a7 100644 --- a/rest_server/operations/identity/list_identitys_service_configs_urlbuilder.go +++ b/rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go @@ -75,7 +75,7 @@ func (o *ListIdentitysServiceConfigsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/patch_identity.go b/rest_management_api_server/operations/identity/patch_identity.go similarity index 94% rename from rest_server/operations/identity/patch_identity.go rename to rest_management_api_server/operations/identity/patch_identity.go index 9e44f2ec2..fcfbfc581 100644 --- a/rest_server/operations/identity/patch_identity.go +++ b/rest_management_api_server/operations/identity/patch_identity.go @@ -53,7 +53,7 @@ func NewPatchIdentity(ctx *middleware.Context, handler PatchIdentityHandler) *Pa return &PatchIdentity{Context: ctx, Handler: handler} } -/*PatchIdentity swagger:route PATCH /identities/{id} Identity patchIdentity +/* PatchIdentity swagger:route PATCH /identities/{id} Identity patchIdentity Update the supplied fields on an identity @@ -68,21 +68,20 @@ type PatchIdentity struct { func (o *PatchIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/patch_identity_parameters.go b/rest_management_api_server/operations/identity/patch_identity_parameters.go similarity index 93% rename from rest_server/operations/identity/patch_identity_parameters.go rename to rest_management_api_server/operations/identity/patch_identity_parameters.go index 0952e8518..5224c44f5 100644 --- a/rest_server/operations/identity/patch_identity_parameters.go +++ b/rest_management_api_server/operations/identity/patch_identity_parameters.go @@ -30,6 +30,7 @@ package identity // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchIdentityParams() PatchIdentityParams { return PatchIdentityParams{} @@ -98,6 +101,11 @@ func (o *PatchIdentityParams) BindRequest(r *http.Request, route *middleware.Mat 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 } @@ -120,7 +128,6 @@ func (o *PatchIdentityParams) bindID(rawData []string, hasKey bool, formats strf // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/patch_identity_responses.go b/rest_management_api_server/operations/identity/patch_identity_responses.go similarity index 100% rename from rest_server/operations/identity/patch_identity_responses.go rename to rest_management_api_server/operations/identity/patch_identity_responses.go diff --git a/rest_server/operations/identity/patch_identity_urlbuilder.go b/rest_management_api_server/operations/identity/patch_identity_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/patch_identity_urlbuilder.go rename to rest_management_api_server/operations/identity/patch_identity_urlbuilder.go index 45d6ee4aa..351590b69 100644 --- a/rest_server/operations/identity/patch_identity_urlbuilder.go +++ b/rest_management_api_server/operations/identity/patch_identity_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/remove_identity_mfa.go b/rest_management_api_server/operations/identity/remove_identity_mfa.go similarity index 93% rename from rest_server/operations/identity/remove_identity_mfa.go rename to rest_management_api_server/operations/identity/remove_identity_mfa.go index 3d495a2fa..5b87ccd5f 100644 --- a/rest_server/operations/identity/remove_identity_mfa.go +++ b/rest_management_api_server/operations/identity/remove_identity_mfa.go @@ -53,7 +53,7 @@ func NewRemoveIdentityMfa(ctx *middleware.Context, handler RemoveIdentityMfaHand return &RemoveIdentityMfa{Context: ctx, Handler: handler} } -/*RemoveIdentityMfa swagger:route DELETE /identities/{id}/mfa Identity MFA removeIdentityMfa +/* RemoveIdentityMfa swagger:route DELETE /identities/{id}/mfa Identity MFA removeIdentityMfa Remove MFA from an identitity @@ -69,21 +69,20 @@ type RemoveIdentityMfa struct { func (o *RemoveIdentityMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *RemoveIdentityMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/remove_identity_mfa_parameters.go b/rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go similarity index 98% rename from rest_server/operations/identity/remove_identity_mfa_parameters.go rename to rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go index 62b64bcbb..9c662c6c4 100644 --- a/rest_server/operations/identity/remove_identity_mfa_parameters.go +++ b/rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewRemoveIdentityMfaParams creates a new RemoveIdentityMfaParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewRemoveIdentityMfaParams() RemoveIdentityMfaParams { return RemoveIdentityMfaParams{} @@ -73,7 +74,6 @@ func (o *RemoveIdentityMfaParams) BindRequest(r *http.Request, route *middleware if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *RemoveIdentityMfaParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/remove_identity_mfa_responses.go b/rest_management_api_server/operations/identity/remove_identity_mfa_responses.go similarity index 100% rename from rest_server/operations/identity/remove_identity_mfa_responses.go rename to rest_management_api_server/operations/identity/remove_identity_mfa_responses.go diff --git a/rest_server/operations/identity/remove_identity_mfa_urlbuilder.go b/rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/remove_identity_mfa_urlbuilder.go rename to rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go index 2ebbdad03..4ceea7b90 100644 --- a/rest_server/operations/identity/remove_identity_mfa_urlbuilder.go +++ b/rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go @@ -75,7 +75,7 @@ func (o *RemoveIdentityMfaURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/identity/update_identity.go b/rest_management_api_server/operations/identity/update_identity.go similarity index 94% rename from rest_server/operations/identity/update_identity.go rename to rest_management_api_server/operations/identity/update_identity.go index 02c98143e..c976cbff0 100644 --- a/rest_server/operations/identity/update_identity.go +++ b/rest_management_api_server/operations/identity/update_identity.go @@ -53,7 +53,7 @@ func NewUpdateIdentity(ctx *middleware.Context, handler UpdateIdentityHandler) * return &UpdateIdentity{Context: ctx, Handler: handler} } -/*UpdateIdentity swagger:route PUT /identities/{id} Identity updateIdentity +/* UpdateIdentity swagger:route PUT /identities/{id} Identity updateIdentity Update all fields on an identity @@ -68,21 +68,20 @@ type UpdateIdentity struct { func (o *UpdateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/identity/update_identity_parameters.go b/rest_management_api_server/operations/identity/update_identity_parameters.go similarity index 93% rename from rest_server/operations/identity/update_identity_parameters.go rename to rest_management_api_server/operations/identity/update_identity_parameters.go index a324e5e91..a6f1289c9 100644 --- a/rest_server/operations/identity/update_identity_parameters.go +++ b/rest_management_api_server/operations/identity/update_identity_parameters.go @@ -30,6 +30,7 @@ package identity // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateIdentityParams() UpdateIdentityParams { return UpdateIdentityParams{} @@ -98,6 +101,11 @@ func (o *UpdateIdentityParams) BindRequest(r *http.Request, route *middleware.Ma 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 } @@ -120,7 +128,6 @@ func (o *UpdateIdentityParams) bindID(rawData []string, hasKey bool, formats str // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/identity/update_identity_responses.go b/rest_management_api_server/operations/identity/update_identity_responses.go similarity index 100% rename from rest_server/operations/identity/update_identity_responses.go rename to rest_management_api_server/operations/identity/update_identity_responses.go diff --git a/rest_server/operations/identity/update_identity_urlbuilder.go b/rest_management_api_server/operations/identity/update_identity_urlbuilder.go similarity index 98% rename from rest_server/operations/identity/update_identity_urlbuilder.go rename to rest_management_api_server/operations/identity/update_identity_urlbuilder.go index 2f3d909cd..d5a0055d1 100644 --- a/rest_server/operations/identity/update_identity_urlbuilder.go +++ b/rest_management_api_server/operations/identity/update_identity_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateIdentityURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/informational/detail_spec.go b/rest_management_api_server/operations/informational/detail_spec.go new file mode 100644 index 000000000..aee44fcb0 --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..31ebaf20c --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_body.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..94e9ee769 --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_body_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..8d8a5c433 --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_body_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9b975e65f --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_body_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..42c16cbcc --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e79976bdb --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..08e38a810 --- /dev/null +++ b/rest_management_api_server/operations/informational/detail_spec_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9cc2d6cc5 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_root.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6944396e9 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_root_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e0be42106 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_root_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..93d77e36f --- /dev/null +++ b/rest_management_api_server/operations/informational/list_root_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..ecbbb5313 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_specs.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..46fff39b6 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_specs_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f71781c6b --- /dev/null +++ b/rest_management_api_server/operations/informational/list_specs_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b3bbcadbf --- /dev/null +++ b/rest_management_api_server/operations/informational/list_specs_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/informational/list_summary.go b/rest_management_api_server/operations/informational/list_summary.go similarity index 94% rename from rest_server/operations/informational/list_summary.go rename to rest_management_api_server/operations/informational/list_summary.go index f33158009..551388711 100644 --- a/rest_server/operations/informational/list_summary.go +++ b/rest_management_api_server/operations/informational/list_summary.go @@ -53,7 +53,7 @@ func NewListSummary(ctx *middleware.Context, handler ListSummaryHandler) *ListSu return &ListSummary{Context: ctx, Handler: handler} } -/*ListSummary swagger:route GET /summary Informational listSummary +/* ListSummary swagger:route GET /summary Informational listSummary Returns a list of accessible resource counts @@ -68,21 +68,20 @@ type ListSummary struct { func (o *ListSummary) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListSummary) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/informational/list_summary_parameters.go b/rest_management_api_server/operations/informational/list_summary_parameters.go similarity index 97% rename from rest_server/operations/informational/list_summary_parameters.go rename to rest_management_api_server/operations/informational/list_summary_parameters.go index 7344cf7ec..521496f63 100644 --- a/rest_server/operations/informational/list_summary_parameters.go +++ b/rest_management_api_server/operations/informational/list_summary_parameters.go @@ -37,7 +37,8 @@ import ( ) // NewListSummaryParams creates a new ListSummaryParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListSummaryParams() ListSummaryParams { return ListSummaryParams{} diff --git a/rest_server/operations/informational/list_summary_responses.go b/rest_management_api_server/operations/informational/list_summary_responses.go similarity index 100% rename from rest_server/operations/informational/list_summary_responses.go rename to rest_management_api_server/operations/informational/list_summary_responses.go diff --git a/rest_server/operations/informational/list_summary_urlbuilder.go b/rest_management_api_server/operations/informational/list_summary_urlbuilder.go similarity index 98% rename from rest_server/operations/informational/list_summary_urlbuilder.go rename to rest_management_api_server/operations/informational/list_summary_urlbuilder.go index 7c23eb308..d8ee701f5 100644 --- a/rest_server/operations/informational/list_summary_urlbuilder.go +++ b/rest_management_api_server/operations/informational/list_summary_urlbuilder.go @@ -63,7 +63,7 @@ func (o *ListSummaryURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/informational/list_version.go b/rest_management_api_server/operations/informational/list_version.go new file mode 100644 index 000000000..b253333c7 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_version.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..efb65aac8 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_version_parameters.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..139195f56 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_version_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..7348f55a5 --- /dev/null +++ b/rest_management_api_server/operations/informational/list_version_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/posture_checks/create_posture_check.go b/rest_management_api_server/operations/posture_checks/create_posture_check.go similarity index 93% rename from rest_server/operations/posture_checks/create_posture_check.go rename to rest_management_api_server/operations/posture_checks/create_posture_check.go index 79564a3a0..093334c44 100644 --- a/rest_server/operations/posture_checks/create_posture_check.go +++ b/rest_management_api_server/operations/posture_checks/create_posture_check.go @@ -53,7 +53,7 @@ func NewCreatePostureCheck(ctx *middleware.Context, handler CreatePostureCheckHa return &CreatePostureCheck{Context: ctx, Handler: handler} } -/*CreatePostureCheck swagger:route POST /posture-checks Posture Checks createPostureCheck +/* CreatePostureCheck swagger:route POST /posture-checks Posture Checks createPostureCheck Creates a Posture Checks @@ -68,21 +68,20 @@ type CreatePostureCheck struct { func (o *CreatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/create_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go similarity index 91% rename from rest_server/operations/posture_checks/create_posture_check_parameters.go rename to rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go index 163ffafff..22cd3005b 100644 --- a/rest_server/operations/posture_checks/create_posture_check_parameters.go +++ b/rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go @@ -30,18 +30,21 @@ package posture_checks // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreatePostureCheckParams() CreatePostureCheckParams { return CreatePostureCheckParams{} @@ -86,6 +89,11 @@ func (o *CreatePostureCheckParams) BindRequest(r *http.Request, route *middlewar 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 } diff --git a/rest_server/operations/posture_checks/create_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/create_posture_check_responses.go similarity index 100% rename from rest_server/operations/posture_checks/create_posture_check_responses.go rename to rest_management_api_server/operations/posture_checks/create_posture_check_responses.go diff --git a/rest_server/operations/posture_checks/create_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go similarity index 98% rename from rest_server/operations/posture_checks/create_posture_check_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go index e3e44b9b6..2e6916147 100644 --- a/rest_server/operations/posture_checks/create_posture_check_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreatePostureCheckURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/delete_posture_check.go b/rest_management_api_server/operations/posture_checks/delete_posture_check.go similarity index 93% rename from rest_server/operations/posture_checks/delete_posture_check.go rename to rest_management_api_server/operations/posture_checks/delete_posture_check.go index dfd7efcbc..88cf508fa 100644 --- a/rest_server/operations/posture_checks/delete_posture_check.go +++ b/rest_management_api_server/operations/posture_checks/delete_posture_check.go @@ -53,7 +53,7 @@ func NewDeletePostureCheck(ctx *middleware.Context, handler DeletePostureCheckHa return &DeletePostureCheck{Context: ctx, Handler: handler} } -/*DeletePostureCheck swagger:route DELETE /posture-checks/{id} Posture Checks deletePostureCheck +/* DeletePostureCheck swagger:route DELETE /posture-checks/{id} Posture Checks deletePostureCheck Deletes an Posture Checks @@ -68,21 +68,20 @@ type DeletePostureCheck struct { func (o *DeletePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeletePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/delete_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go similarity index 98% rename from rest_server/operations/posture_checks/delete_posture_check_parameters.go rename to rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go index 50aba8be9..27ba30268 100644 --- a/rest_server/operations/posture_checks/delete_posture_check_parameters.go +++ b/rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeletePostureCheckParams creates a new DeletePostureCheckParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeletePostureCheckParams() DeletePostureCheckParams { return DeletePostureCheckParams{} @@ -73,7 +74,6 @@ func (o *DeletePostureCheckParams) BindRequest(r *http.Request, route *middlewar if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeletePostureCheckParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/posture_checks/delete_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_responses.go similarity index 100% rename from rest_server/operations/posture_checks/delete_posture_check_responses.go rename to rest_management_api_server/operations/posture_checks/delete_posture_check_responses.go diff --git a/rest_server/operations/posture_checks/delete_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go similarity index 98% rename from rest_server/operations/posture_checks/delete_posture_check_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go index bba147fd8..8931a447f 100644 --- a/rest_server/operations/posture_checks/delete_posture_check_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeletePostureCheckURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/detail_posture_check.go b/rest_management_api_server/operations/posture_checks/detail_posture_check.go similarity index 93% rename from rest_server/operations/posture_checks/detail_posture_check.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check.go index 28f789ba9..4e95fa0cd 100644 --- a/rest_server/operations/posture_checks/detail_posture_check.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check.go @@ -53,7 +53,7 @@ func NewDetailPostureCheck(ctx *middleware.Context, handler DetailPostureCheckHa return &DetailPostureCheck{Context: ctx, Handler: handler} } -/*DetailPostureCheck swagger:route GET /posture-checks/{id} Posture Checks detailPostureCheck +/* DetailPostureCheck swagger:route GET /posture-checks/{id} Posture Checks detailPostureCheck Retrieves a single Posture Checks @@ -68,21 +68,20 @@ type DetailPostureCheck struct { func (o *DetailPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/detail_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go similarity index 98% rename from rest_server/operations/posture_checks/detail_posture_check_parameters.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go index e852d744c..1aee8bb8b 100644 --- a/rest_server/operations/posture_checks/detail_posture_check_parameters.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailPostureCheckParams creates a new DetailPostureCheckParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailPostureCheckParams() DetailPostureCheckParams { return DetailPostureCheckParams{} @@ -73,7 +74,6 @@ func (o *DetailPostureCheckParams) BindRequest(r *http.Request, route *middlewar if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailPostureCheckParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/posture_checks/detail_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_responses.go similarity index 100% rename from rest_server/operations/posture_checks/detail_posture_check_responses.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_responses.go diff --git a/rest_server/operations/posture_checks/detail_posture_check_type.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type.go similarity index 93% rename from rest_server/operations/posture_checks/detail_posture_check_type.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_type.go index 6a0fdd3f7..2444cea92 100644 --- a/rest_server/operations/posture_checks/detail_posture_check_type.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check_type.go @@ -53,7 +53,7 @@ func NewDetailPostureCheckType(ctx *middleware.Context, handler DetailPostureChe return &DetailPostureCheckType{Context: ctx, Handler: handler} } -/*DetailPostureCheckType swagger:route GET /posture-check-types/{id} Posture Checks detailPostureCheckType +/* DetailPostureCheckType swagger:route GET /posture-check-types/{id} Posture Checks detailPostureCheckType Retrieves a single posture check type @@ -68,21 +68,20 @@ type DetailPostureCheckType struct { func (o *DetailPostureCheckType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailPostureCheckType) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/detail_posture_check_type_parameters.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go similarity index 98% rename from rest_server/operations/posture_checks/detail_posture_check_type_parameters.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go index 42801f8f9..8e0b207ab 100644 --- a/rest_server/operations/posture_checks/detail_posture_check_type_parameters.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailPostureCheckTypeParams creates a new DetailPostureCheckTypeParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailPostureCheckTypeParams() DetailPostureCheckTypeParams { return DetailPostureCheckTypeParams{} @@ -73,7 +74,6 @@ func (o *DetailPostureCheckTypeParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailPostureCheckTypeParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/posture_checks/detail_posture_check_type_responses.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_responses.go similarity index 100% rename from rest_server/operations/posture_checks/detail_posture_check_type_responses.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_type_responses.go diff --git a/rest_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go similarity index 99% rename from rest_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go index 59262a5fd..404f4b262 100644 --- a/rest_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailPostureCheckTypeURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/detail_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go similarity index 98% rename from rest_server/operations/posture_checks/detail_posture_check_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go index a279b55a8..e0b6b4881 100644 --- a/rest_server/operations/posture_checks/detail_posture_check_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailPostureCheckURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/list_posture_check_types.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types.go similarity index 93% rename from rest_server/operations/posture_checks/list_posture_check_types.go rename to rest_management_api_server/operations/posture_checks/list_posture_check_types.go index 551c1d0b0..bda91c355 100644 --- a/rest_server/operations/posture_checks/list_posture_check_types.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_check_types.go @@ -53,7 +53,7 @@ func NewListPostureCheckTypes(ctx *middleware.Context, handler ListPostureCheckT return &ListPostureCheckTypes{Context: ctx, Handler: handler} } -/*ListPostureCheckTypes swagger:route GET /posture-check-types Posture Checks listPostureCheckTypes +/* ListPostureCheckTypes swagger:route GET /posture-check-types Posture Checks listPostureCheckTypes List a subset of posture check types @@ -69,21 +69,20 @@ type ListPostureCheckTypes struct { func (o *ListPostureCheckTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListPostureCheckTypes) ServeHTTP(rw http.ResponseWriter, r *http.Reques } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/list_posture_check_types_parameters.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go similarity index 98% rename from rest_server/operations/posture_checks/list_posture_check_types_parameters.go rename to rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go index fad3442ad..7dc4f4267 100644 --- a/rest_server/operations/posture_checks/list_posture_check_types_parameters.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListPostureCheckTypesParams creates a new ListPostureCheckTypesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListPostureCheckTypesParams() ListPostureCheckTypesParams { return ListPostureCheckTypesParams{} @@ -94,7 +95,6 @@ func (o *ListPostureCheckTypesParams) BindRequest(r *http.Request, route *middle if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListPostureCheckTypesParams) bindFilter(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListPostureCheckTypesParams) bindLimit(rawData []string, hasKey bool, f // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListPostureCheckTypesParams) bindOffset(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/posture_checks/list_posture_check_types_responses.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_responses.go similarity index 100% rename from rest_server/operations/posture_checks/list_posture_check_types_responses.go rename to rest_management_api_server/operations/posture_checks/list_posture_check_types_responses.go diff --git a/rest_server/operations/posture_checks/list_posture_check_types_urlbuilder.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go similarity index 99% rename from rest_server/operations/posture_checks/list_posture_check_types_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go index b3d24c672..f4beebf9e 100644 --- a/rest_server/operations/posture_checks/list_posture_check_types_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListPostureCheckTypesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/list_posture_checks.go b/rest_management_api_server/operations/posture_checks/list_posture_checks.go similarity index 93% rename from rest_server/operations/posture_checks/list_posture_checks.go rename to rest_management_api_server/operations/posture_checks/list_posture_checks.go index 46a97df0b..8356d3d73 100644 --- a/rest_server/operations/posture_checks/list_posture_checks.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_checks.go @@ -53,7 +53,7 @@ func NewListPostureChecks(ctx *middleware.Context, handler ListPostureChecksHand return &ListPostureChecks{Context: ctx, Handler: handler} } -/*ListPostureChecks swagger:route GET /posture-checks Posture Checks listPostureChecks +/* ListPostureChecks swagger:route GET /posture-checks Posture Checks listPostureChecks List a subset of posture checks @@ -69,21 +69,20 @@ type ListPostureChecks struct { func (o *ListPostureChecks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListPostureChecks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/list_posture_checks_parameters.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go similarity index 99% rename from rest_server/operations/posture_checks/list_posture_checks_parameters.go rename to rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go index 4459d7859..3b3bc8055 100644 --- a/rest_server/operations/posture_checks/list_posture_checks_parameters.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListPostureChecksParams creates a new ListPostureChecksParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListPostureChecksParams() ListPostureChecksParams { return ListPostureChecksParams{} @@ -113,7 +114,6 @@ func (o *ListPostureChecksParams) BindRequest(r *http.Request, route *middleware if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -129,10 +129,10 @@ func (o *ListPostureChecksParams) bindFilter(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -147,6 +147,7 @@ func (o *ListPostureChecksParams) bindLimit(rawData []string, hasKey bool, forma // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -169,6 +170,7 @@ func (o *ListPostureChecksParams) bindOffset(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -186,10 +188,8 @@ func (o *ListPostureChecksParams) bindOffset(rawData []string, hasKey bool, form // // 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 } @@ -215,10 +215,10 @@ func (o *ListPostureChecksParams) bindRoleSemantic(rawData []string, hasKey bool // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.RoleSemantic = &raw return nil diff --git a/rest_server/operations/posture_checks/list_posture_checks_responses.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_responses.go similarity index 100% rename from rest_server/operations/posture_checks/list_posture_checks_responses.go rename to rest_management_api_server/operations/posture_checks/list_posture_checks_responses.go diff --git a/rest_server/operations/posture_checks/list_posture_checks_urlbuilder.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go similarity index 99% rename from rest_server/operations/posture_checks/list_posture_checks_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go index 620a66066..44922d44a 100644 --- a/rest_server/operations/posture_checks/list_posture_checks_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go @@ -73,7 +73,7 @@ func (o *ListPostureChecksURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/patch_posture_check.go b/rest_management_api_server/operations/posture_checks/patch_posture_check.go similarity index 93% rename from rest_server/operations/posture_checks/patch_posture_check.go rename to rest_management_api_server/operations/posture_checks/patch_posture_check.go index c70a68584..4abf6a948 100644 --- a/rest_server/operations/posture_checks/patch_posture_check.go +++ b/rest_management_api_server/operations/posture_checks/patch_posture_check.go @@ -53,7 +53,7 @@ func NewPatchPostureCheck(ctx *middleware.Context, handler PatchPostureCheckHand return &PatchPostureCheck{Context: ctx, Handler: handler} } -/*PatchPostureCheck swagger:route PATCH /posture-checks/{id} Posture Checks patchPostureCheck +/* PatchPostureCheck swagger:route PATCH /posture-checks/{id} Posture Checks patchPostureCheck Update the supplied fields on a Posture Checks @@ -68,21 +68,20 @@ type PatchPostureCheck struct { func (o *PatchPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/patch_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go similarity index 93% rename from rest_server/operations/posture_checks/patch_posture_check_parameters.go rename to rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go index 7d7cd597f..b3a250736 100644 --- a/rest_server/operations/posture_checks/patch_posture_check_parameters.go +++ b/rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go @@ -30,6 +30,7 @@ package posture_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchPostureCheckParams() PatchPostureCheckParams { return PatchPostureCheckParams{} @@ -97,6 +100,11 @@ func (o *PatchPostureCheckParams) BindRequest(r *http.Request, route *middleware 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 } @@ -119,7 +127,6 @@ func (o *PatchPostureCheckParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/posture_checks/patch_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_responses.go similarity index 100% rename from rest_server/operations/posture_checks/patch_posture_check_responses.go rename to rest_management_api_server/operations/posture_checks/patch_posture_check_responses.go diff --git a/rest_server/operations/posture_checks/patch_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go similarity index 98% rename from rest_server/operations/posture_checks/patch_posture_check_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go index 2e7e18916..7497f301b 100644 --- a/rest_server/operations/posture_checks/patch_posture_check_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchPostureCheckURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/posture_checks/update_posture_check.go b/rest_management_api_server/operations/posture_checks/update_posture_check.go similarity index 93% rename from rest_server/operations/posture_checks/update_posture_check.go rename to rest_management_api_server/operations/posture_checks/update_posture_check.go index 271cbcebc..b10acf509 100644 --- a/rest_server/operations/posture_checks/update_posture_check.go +++ b/rest_management_api_server/operations/posture_checks/update_posture_check.go @@ -53,7 +53,7 @@ func NewUpdatePostureCheck(ctx *middleware.Context, handler UpdatePostureCheckHa return &UpdatePostureCheck{Context: ctx, Handler: handler} } -/*UpdatePostureCheck swagger:route PUT /posture-checks/{id} Posture Checks updatePostureCheck +/* UpdatePostureCheck swagger:route PUT /posture-checks/{id} Posture Checks updatePostureCheck Update all fields on a Posture Checks @@ -68,21 +68,20 @@ type UpdatePostureCheck struct { func (o *UpdatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/posture_checks/update_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go similarity index 93% rename from rest_server/operations/posture_checks/update_posture_check_parameters.go rename to rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go index e3080f18c..90f2adb77 100644 --- a/rest_server/operations/posture_checks/update_posture_check_parameters.go +++ b/rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go @@ -30,6 +30,7 @@ package posture_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdatePostureCheckParams() UpdatePostureCheckParams { return UpdatePostureCheckParams{} @@ -97,6 +100,11 @@ func (o *UpdatePostureCheckParams) BindRequest(r *http.Request, route *middlewar 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 } @@ -119,7 +127,6 @@ func (o *UpdatePostureCheckParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/posture_checks/update_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/update_posture_check_responses.go similarity index 100% rename from rest_server/operations/posture_checks/update_posture_check_responses.go rename to rest_management_api_server/operations/posture_checks/update_posture_check_responses.go diff --git a/rest_server/operations/posture_checks/update_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go similarity index 98% rename from rest_server/operations/posture_checks/update_posture_check_urlbuilder.go rename to rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go index 2b343b3f4..7be3c777f 100644 --- a/rest_server/operations/posture_checks/update_posture_check_urlbuilder.go +++ b/rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdatePostureCheckURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/role_attributes/list_edge_router_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go similarity index 93% rename from rest_server/operations/role_attributes/list_edge_router_role_attributes.go rename to rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go index cdba05e67..be49c862e 100644 --- a/rest_server/operations/role_attributes/list_edge_router_role_attributes.go +++ b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go @@ -53,7 +53,7 @@ func NewListEdgeRouterRoleAttributes(ctx *middleware.Context, handler ListEdgeRo return &ListEdgeRouterRoleAttributes{Context: ctx, Handler: handler} } -/*ListEdgeRouterRoleAttributes swagger:route GET /edge-router-role-attributes Role Attributes listEdgeRouterRoleAttributes +/* ListEdgeRouterRoleAttributes swagger:route GET /edge-router-role-attributes Role Attributes listEdgeRouterRoleAttributes List role attributes in use by edge routers @@ -69,21 +69,20 @@ type ListEdgeRouterRoleAttributes struct { func (o *ListEdgeRouterRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListEdgeRouterRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/role_attributes/list_edge_router_role_attributes_parameters.go rename to rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_parameters.go index cdac43bb4..589b72dfa 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListEdgeRouterRoleAttributesParams creates a new ListEdgeRouterRoleAttributesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListEdgeRouterRoleAttributesParams() ListEdgeRouterRoleAttributesParams { return ListEdgeRouterRoleAttributesParams{} @@ -94,7 +95,6 @@ func (o *ListEdgeRouterRoleAttributesParams) BindRequest(r *http.Request, route if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListEdgeRouterRoleAttributesParams) bindFilter(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListEdgeRouterRoleAttributesParams) bindLimit(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListEdgeRouterRoleAttributesParams) bindOffset(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/role_attributes/list_edge_router_role_attributes_responses.go rename to rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go rename to rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go index cab95c786..efdf84822 100644 --- a/rest_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 @@ -71,7 +71,7 @@ func (o *ListEdgeRouterRoleAttributesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/role_attributes/list_identity_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go similarity index 93% rename from rest_server/operations/role_attributes/list_identity_role_attributes.go rename to rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go index 3bf6fd2b1..ad8979933 100644 --- a/rest_server/operations/role_attributes/list_identity_role_attributes.go +++ b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go @@ -53,7 +53,7 @@ func NewListIdentityRoleAttributes(ctx *middleware.Context, handler ListIdentity return &ListIdentityRoleAttributes{Context: ctx, Handler: handler} } -/*ListIdentityRoleAttributes swagger:route GET /identity-role-attributes Role Attributes listIdentityRoleAttributes +/* ListIdentityRoleAttributes swagger:route GET /identity-role-attributes Role Attributes listIdentityRoleAttributes List role attributes in use by identities @@ -69,21 +69,20 @@ type ListIdentityRoleAttributes struct { func (o *ListIdentityRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListIdentityRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.R } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/role_attributes/list_identity_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go similarity index 98% rename from rest_server/operations/role_attributes/list_identity_role_attributes_parameters.go rename to rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go index e70ce3fe8..235642a2f 100644 --- a/rest_server/operations/role_attributes/list_identity_role_attributes_parameters.go +++ b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListIdentityRoleAttributesParams creates a new ListIdentityRoleAttributesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListIdentityRoleAttributesParams() ListIdentityRoleAttributesParams { return ListIdentityRoleAttributesParams{} @@ -94,7 +95,6 @@ func (o *ListIdentityRoleAttributesParams) BindRequest(r *http.Request, route *m if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListIdentityRoleAttributesParams) bindFilter(rawData []string, hasKey b // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListIdentityRoleAttributesParams) bindLimit(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListIdentityRoleAttributesParams) bindOffset(rawData []string, hasKey b // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/role_attributes/list_identity_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_responses.go similarity index 100% rename from rest_server/operations/role_attributes/list_identity_role_attributes_responses.go rename to rest_management_api_server/operations/role_attributes/list_identity_role_attributes_responses.go diff --git a/rest_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go similarity index 99% rename from rest_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go rename to rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go index 7f6a0e316..fe23e5a43 100644 --- a/rest_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go +++ b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListIdentityRoleAttributesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/role_attributes/list_service_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes.go similarity index 93% rename from rest_server/operations/role_attributes/list_service_role_attributes.go rename to rest_management_api_server/operations/role_attributes/list_service_role_attributes.go index 41855905d..586f19bd9 100644 --- a/rest_server/operations/role_attributes/list_service_role_attributes.go +++ b/rest_management_api_server/operations/role_attributes/list_service_role_attributes.go @@ -53,7 +53,7 @@ func NewListServiceRoleAttributes(ctx *middleware.Context, handler ListServiceRo return &ListServiceRoleAttributes{Context: ctx, Handler: handler} } -/*ListServiceRoleAttributes swagger:route GET /service-role-attributes Role Attributes listServiceRoleAttributes +/* ListServiceRoleAttributes swagger:route GET /service-role-attributes Role Attributes listServiceRoleAttributes List role attributes in use by services @@ -69,21 +69,20 @@ type ListServiceRoleAttributes struct { func (o *ListServiceRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Re } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/role_attributes/list_service_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go similarity index 98% rename from rest_server/operations/role_attributes/list_service_role_attributes_parameters.go rename to rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go index 1d6b428fa..6b513bc86 100644 --- a/rest_server/operations/role_attributes/list_service_role_attributes_parameters.go +++ b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceRoleAttributesParams creates a new ListServiceRoleAttributesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceRoleAttributesParams() ListServiceRoleAttributesParams { return ListServiceRoleAttributesParams{} @@ -94,7 +95,6 @@ func (o *ListServiceRoleAttributesParams) BindRequest(r *http.Request, route *mi if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListServiceRoleAttributesParams) bindFilter(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListServiceRoleAttributesParams) bindLimit(rawData []string, hasKey boo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListServiceRoleAttributesParams) bindOffset(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/role_attributes/list_service_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_responses.go similarity index 100% rename from rest_server/operations/role_attributes/list_service_role_attributes_responses.go rename to rest_management_api_server/operations/role_attributes/list_service_role_attributes_responses.go diff --git a/rest_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go similarity index 99% rename from rest_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go rename to rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go index 73461faee..8b72e9a9f 100644 --- a/rest_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go +++ b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListServiceRoleAttributesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/create_router.go b/rest_management_api_server/operations/router/create_router.go new file mode 100644 index 000000000..4b223f356 --- /dev/null +++ b/rest_management_api_server/operations/router/create_router.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f9a413e48 --- /dev/null +++ b/rest_management_api_server/operations/router/create_router_parameters.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..9127bf701 --- /dev/null +++ b/rest_management_api_server/operations/router/create_router_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..26d5f5ea0 --- /dev/null +++ b/rest_management_api_server/operations/router/create_router_urlbuilder.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/transit_router/create_transit_router.go b/rest_management_api_server/operations/router/create_transit_router.go similarity index 91% rename from rest_server/operations/transit_router/create_transit_router.go rename to rest_management_api_server/operations/router/create_transit_router.go index bbebd1d3a..8de76f08a 100644 --- a/rest_server/operations/transit_router/create_transit_router.go +++ b/rest_management_api_server/operations/router/create_transit_router.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewCreateTransitRouter(ctx *middleware.Context, handler CreateTransitRouter return &CreateTransitRouter{Context: ctx, Handler: handler} } -/*CreateTransitRouter swagger:route POST /transit-routers Transit Router createTransitRouter +/* CreateTransitRouter swagger:route POST /transit-routers Router createTransitRouter -Create a transit router resource +Create a router resource -Create a transit router resource. Requires admin access. +Create a router resource. Requires admin access. */ type CreateTransitRouter struct { @@ -68,21 +68,20 @@ type CreateTransitRouter struct { func (o *CreateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/create_transit_router_parameters.go b/rest_management_api_server/operations/router/create_transit_router_parameters.go similarity index 88% rename from rest_server/operations/transit_router/create_transit_router_parameters.go rename to rest_management_api_server/operations/router/create_transit_router_parameters.go index 787121193..d3499f5a7 100644 --- a/rest_server/operations/transit_router/create_transit_router_parameters.go +++ b/rest_management_api_server/operations/router/create_transit_router_parameters.go @@ -24,24 +24,27 @@ // __/ | // |___/ -package transit_router +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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateTransitRouterParams() CreateTransitRouterParams { return CreateTransitRouterParams{} @@ -56,11 +59,11 @@ type CreateTransitRouterParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` - /*A transit router to create + /*A router to create Required: true In: body */ - Router *rest_model.TransitRouterCreate + Router *rest_model.RouterCreate } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -74,7 +77,7 @@ func (o *CreateTransitRouterParams) BindRequest(r *http.Request, route *middlewa if runtime.HasBody(r) { defer r.Body.Close() - var body rest_model.TransitRouterCreate + 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", "")) @@ -87,6 +90,11 @@ func (o *CreateTransitRouterParams) BindRequest(r *http.Request, route *middlewa 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 } diff --git a/rest_server/operations/transit_router/create_transit_router_responses.go b/rest_management_api_server/operations/router/create_transit_router_responses.go similarity index 99% rename from rest_server/operations/transit_router/create_transit_router_responses.go rename to rest_management_api_server/operations/router/create_transit_router_responses.go index 7a52e3634..bff5df004 100644 --- a/rest_server/operations/transit_router/create_transit_router_responses.go +++ b/rest_management_api_server/operations/router/create_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/rest_server/operations/transit_router/create_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/create_transit_router_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/create_transit_router_urlbuilder.go rename to rest_management_api_server/operations/router/create_transit_router_urlbuilder.go index a805525f0..89eb60913 100644 --- a/rest_server/operations/transit_router/create_transit_router_urlbuilder.go +++ b/rest_management_api_server/operations/router/create_transit_router_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -63,7 +63,7 @@ func (o *CreateTransitRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/delete_router.go b/rest_management_api_server/operations/router/delete_router.go new file mode 100644 index 000000000..bff0b4f65 --- /dev/null +++ b/rest_management_api_server/operations/router/delete_router.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f96a3eac1 --- /dev/null +++ b/rest_management_api_server/operations/router/delete_router_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..75b930ea4 --- /dev/null +++ b/rest_management_api_server/operations/router/delete_router_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b8ee74b7a --- /dev/null +++ b/rest_management_api_server/operations/router/delete_router_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/transit_router/delete_transit_router.go b/rest_management_api_server/operations/router/delete_transit_router.go similarity index 91% rename from rest_server/operations/transit_router/delete_transit_router.go rename to rest_management_api_server/operations/router/delete_transit_router.go index 87250a999..20476217e 100644 --- a/rest_server/operations/transit_router/delete_transit_router.go +++ b/rest_management_api_server/operations/router/delete_transit_router.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewDeleteTransitRouter(ctx *middleware.Context, handler DeleteTransitRouter return &DeleteTransitRouter{Context: ctx, Handler: handler} } -/*DeleteTransitRouter swagger:route DELETE /transit-routers/{id} Transit Router deleteTransitRouter +/* DeleteTransitRouter swagger:route DELETE /transit-routers/{id} Router deleteTransitRouter -Delete a transit router +Delete a router -Delete a transit router by id. Requires admin access. +Delete a router by id. Requires admin access. */ type DeleteTransitRouter struct { @@ -68,21 +68,20 @@ type DeleteTransitRouter struct { func (o *DeleteTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/delete_transit_router_parameters.go b/rest_management_api_server/operations/router/delete_transit_router_parameters.go similarity index 97% rename from rest_server/operations/transit_router/delete_transit_router_parameters.go rename to rest_management_api_server/operations/router/delete_transit_router_parameters.go index 79ba45ddd..3ebb6e828 100644 --- a/rest_server/operations/transit_router/delete_transit_router_parameters.go +++ b/rest_management_api_server/operations/router/delete_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -38,7 +38,8 @@ import ( ) // NewDeleteTransitRouterParams creates a new DeleteTransitRouterParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteTransitRouterParams() DeleteTransitRouterParams { return DeleteTransitRouterParams{} @@ -73,7 +74,6 @@ func (o *DeleteTransitRouterParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteTransitRouterParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/transit_router/delete_transit_router_responses.go b/rest_management_api_server/operations/router/delete_transit_router_responses.go similarity index 99% rename from rest_server/operations/transit_router/delete_transit_router_responses.go rename to rest_management_api_server/operations/router/delete_transit_router_responses.go index 4137f5200..28e5e8106 100644 --- a/rest_server/operations/transit_router/delete_transit_router_responses.go +++ b/rest_management_api_server/operations/router/delete_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/rest_server/operations/transit_router/delete_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/delete_transit_router_urlbuilder.go rename to rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go index 798507b5f..c8002a3c8 100644 --- a/rest_server/operations/transit_router/delete_transit_router_urlbuilder.go +++ b/rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -75,7 +75,7 @@ func (o *DeleteTransitRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/detail_router.go b/rest_management_api_server/operations/router/detail_router.go new file mode 100644 index 000000000..c12c22aa2 --- /dev/null +++ b/rest_management_api_server/operations/router/detail_router.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f1080bd1a --- /dev/null +++ b/rest_management_api_server/operations/router/detail_router_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..ae89c53a1 --- /dev/null +++ b/rest_management_api_server/operations/router/detail_router_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4b09a5495 --- /dev/null +++ b/rest_management_api_server/operations/router/detail_router_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/transit_router/detail_transit_router.go b/rest_management_api_server/operations/router/detail_transit_router.go similarity index 90% rename from rest_server/operations/transit_router/detail_transit_router.go rename to rest_management_api_server/operations/router/detail_transit_router.go index 708b349ce..194d76909 100644 --- a/rest_server/operations/transit_router/detail_transit_router.go +++ b/rest_management_api_server/operations/router/detail_transit_router.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewDetailTransitRouter(ctx *middleware.Context, handler DetailTransitRouter return &DetailTransitRouter{Context: ctx, Handler: handler} } -/*DetailTransitRouter swagger:route GET /transit-routers/{id} Transit Router detailTransitRouter +/* DetailTransitRouter swagger:route GET /transit-routers/{id} Router detailTransitRouter -Retrieves a single transit router +Retrieves a single router -Retrieves a single transit router by id. Requires admin access. +Retrieves a single router by id. Requires admin access. */ type DetailTransitRouter struct { @@ -68,21 +68,20 @@ type DetailTransitRouter struct { func (o *DetailTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/detail_transit_router_parameters.go b/rest_management_api_server/operations/router/detail_transit_router_parameters.go similarity index 97% rename from rest_server/operations/transit_router/detail_transit_router_parameters.go rename to rest_management_api_server/operations/router/detail_transit_router_parameters.go index 4a8ba7e53..27cda500e 100644 --- a/rest_server/operations/transit_router/detail_transit_router_parameters.go +++ b/rest_management_api_server/operations/router/detail_transit_router_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -38,7 +38,8 @@ import ( ) // NewDetailTransitRouterParams creates a new DetailTransitRouterParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailTransitRouterParams() DetailTransitRouterParams { return DetailTransitRouterParams{} @@ -73,7 +74,6 @@ func (o *DetailTransitRouterParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailTransitRouterParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/transit_router/detail_transit_router_responses.go b/rest_management_api_server/operations/router/detail_transit_router_responses.go similarity index 95% rename from rest_server/operations/transit_router/detail_transit_router_responses.go rename to rest_management_api_server/operations/router/detail_transit_router_responses.go index 8fda35fd6..a108e3a06 100644 --- a/rest_server/operations/transit_router/detail_transit_router_responses.go +++ b/rest_management_api_server/operations/router/detail_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -40,7 +40,7 @@ import ( // DetailTransitRouterOKCode is the HTTP code returned for type DetailTransitRouterOK const DetailTransitRouterOKCode int = 200 -/*DetailTransitRouterOK A single transit router +/*DetailTransitRouterOK A single router swagger:response detailTransitRouterOK */ @@ -49,7 +49,7 @@ type DetailTransitRouterOK struct { /* In: Body */ - Payload *rest_model.DetailTransitRouterEnvelope `json:"body,omitempty"` + Payload *rest_model.DetailRouterEnvelope `json:"body,omitempty"` } // NewDetailTransitRouterOK creates DetailTransitRouterOK with default headers values @@ -59,13 +59,13 @@ func NewDetailTransitRouterOK() *DetailTransitRouterOK { } // WithPayload adds the payload to the detail transit router o k response -func (o *DetailTransitRouterOK) WithPayload(payload *rest_model.DetailTransitRouterEnvelope) *DetailTransitRouterOK { +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.DetailTransitRouterEnvelope) { +func (o *DetailTransitRouterOK) SetPayload(payload *rest_model.DetailRouterEnvelope) { o.Payload = payload } diff --git a/rest_server/operations/transit_router/detail_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/detail_transit_router_urlbuilder.go rename to rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go index 04706c02d..565c53a6f 100644 --- a/rest_server/operations/transit_router/detail_transit_router_urlbuilder.go +++ b/rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -75,7 +75,7 @@ func (o *DetailTransitRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/list_routers.go b/rest_management_api_server/operations/router/list_routers.go new file mode 100644 index 000000000..ac642693a --- /dev/null +++ b/rest_management_api_server/operations/router/list_routers.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/geo_region/list_geo_regions_parameters.go b/rest_management_api_server/operations/router/list_routers_parameters.go similarity index 81% rename from rest_server/operations/geo_region/list_geo_regions_parameters.go rename to rest_management_api_server/operations/router/list_routers_parameters.go index 36f18896b..7fa1c0196 100644 --- a/rest_server/operations/geo_region/list_geo_regions_parameters.go +++ b/rest_management_api_server/operations/router/list_routers_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -39,18 +39,19 @@ import ( "github.com/go-openapi/swag" ) -// NewListGeoRegionsParams creates a new ListGeoRegionsParams object -// no default values defined in spec. -func NewListGeoRegionsParams() ListGeoRegionsParams { +// NewListRoutersParams creates a new ListRoutersParams object +// +// There are no default values defined in the spec. +func NewListRoutersParams() ListRoutersParams { - return ListGeoRegionsParams{} + return ListRoutersParams{} } -// ListGeoRegionsParams contains all the bound params for the list geo regions operation +// ListRoutersParams contains all the bound params for the list routers operation // typically these are obtained from a http.Request // -// swagger:parameters listGeoRegions -type ListGeoRegionsParams struct { +// swagger:parameters listRouters +type ListRoutersParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` @@ -72,8 +73,8 @@ type ListGeoRegionsParams struct { // 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 NewListGeoRegionsParams() beforehand. -func (o *ListGeoRegionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { +// 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 @@ -94,7 +95,6 @@ func (o *ListGeoRegionsParams) BindRequest(r *http.Request, route *middleware.Ma if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -102,7 +102,7 @@ func (o *ListGeoRegionsParams) BindRequest(r *http.Request, route *middleware.Ma } // bindFilter binds and validates parameter Filter from query. -func (o *ListGeoRegionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { +func (o *ListRoutersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -110,17 +110,17 @@ func (o *ListGeoRegionsParams) bindFilter(rawData []string, hasKey bool, formats // 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 *ListGeoRegionsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { +func (o *ListRoutersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -128,6 +128,7 @@ func (o *ListGeoRegionsParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -142,7 +143,7 @@ func (o *ListGeoRegionsParams) bindLimit(rawData []string, hasKey bool, formats } // bindOffset binds and validates parameter Offset from query. -func (o *ListGeoRegionsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { +func (o *ListRoutersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -150,6 +151,7 @@ func (o *ListGeoRegionsParams) bindOffset(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/geo_region/list_geo_regions_responses.go b/rest_management_api_server/operations/router/list_routers_responses.go similarity index 50% rename from rest_server/operations/geo_region/list_geo_regions_responses.go rename to rest_management_api_server/operations/router/list_routers_responses.go index 668f19dcd..e9ba8b296 100644 --- a/rest_server/operations/geo_region/list_geo_regions_responses.go +++ b/rest_management_api_server/operations/router/list_routers_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -37,40 +37,40 @@ import ( "github.com/openziti/edge/rest_model" ) -// ListGeoRegionsOKCode is the HTTP code returned for type ListGeoRegionsOK -const ListGeoRegionsOKCode int = 200 +// ListRoutersOKCode is the HTTP code returned for type ListRoutersOK +const ListRoutersOKCode int = 200 -/*ListGeoRegionsOK A list of geo-regions +/*ListRoutersOK A list of specifications -swagger:response listGeoRegionsOK +swagger:response listRoutersOK */ -type ListGeoRegionsOK struct { +type ListRoutersOK struct { /* In: Body */ - Payload *rest_model.ListGeoRegionsEnvelope `json:"body,omitempty"` + Payload *rest_model.ListRoutersEnvelope `json:"body,omitempty"` } -// NewListGeoRegionsOK creates ListGeoRegionsOK with default headers values -func NewListGeoRegionsOK() *ListGeoRegionsOK { +// NewListRoutersOK creates ListRoutersOK with default headers values +func NewListRoutersOK() *ListRoutersOK { - return &ListGeoRegionsOK{} + return &ListRoutersOK{} } -// WithPayload adds the payload to the list geo regions o k response -func (o *ListGeoRegionsOK) WithPayload(payload *rest_model.ListGeoRegionsEnvelope) *ListGeoRegionsOK { +// 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 geo regions o k response -func (o *ListGeoRegionsOK) SetPayload(payload *rest_model.ListGeoRegionsEnvelope) { +// 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 *ListGeoRegionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *ListRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(200) if o.Payload != nil { @@ -81,14 +81,14 @@ func (o *ListGeoRegionsOK) WriteResponse(rw http.ResponseWriter, producer runtim } } -// ListGeoRegionsUnauthorizedCode is the HTTP code returned for type ListGeoRegionsUnauthorized -const ListGeoRegionsUnauthorizedCode int = 401 +// ListRoutersUnauthorizedCode is the HTTP code returned for type ListRoutersUnauthorized +const ListRoutersUnauthorizedCode int = 401 -/*ListGeoRegionsUnauthorized The currently supplied session does not have the correct access rights to request this resource +/*ListRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource -swagger:response listGeoRegionsUnauthorized +swagger:response listRoutersUnauthorized */ -type ListGeoRegionsUnauthorized struct { +type ListRoutersUnauthorized struct { /* In: Body @@ -96,25 +96,25 @@ type ListGeoRegionsUnauthorized struct { Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` } -// NewListGeoRegionsUnauthorized creates ListGeoRegionsUnauthorized with default headers values -func NewListGeoRegionsUnauthorized() *ListGeoRegionsUnauthorized { +// NewListRoutersUnauthorized creates ListRoutersUnauthorized with default headers values +func NewListRoutersUnauthorized() *ListRoutersUnauthorized { - return &ListGeoRegionsUnauthorized{} + return &ListRoutersUnauthorized{} } -// WithPayload adds the payload to the list geo regions unauthorized response -func (o *ListGeoRegionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListGeoRegionsUnauthorized { +// 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 geo regions unauthorized response -func (o *ListGeoRegionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { +// 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 *ListGeoRegionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *ListRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(401) if o.Payload != nil { diff --git a/rest_server/operations/geo_region/list_geo_regions_urlbuilder.go b/rest_management_api_server/operations/router/list_routers_urlbuilder.go similarity index 83% rename from rest_server/operations/geo_region/list_geo_regions_urlbuilder.go rename to rest_management_api_server/operations/router/list_routers_urlbuilder.go index f6cadcb6c..9bab35977 100644 --- a/rest_server/operations/geo_region/list_geo_regions_urlbuilder.go +++ b/rest_management_api_server/operations/router/list_routers_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package geo_region +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -37,8 +37,8 @@ import ( "github.com/go-openapi/swag" ) -// ListGeoRegionsURL generates an URL for the list geo regions operation -type ListGeoRegionsURL struct { +// ListRoutersURL generates an URL for the list routers operation +type ListRoutersURL struct { Filter *string Limit *int64 Offset *int64 @@ -51,7 +51,7 @@ type ListGeoRegionsURL 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 *ListGeoRegionsURL) WithBasePath(bp string) *ListGeoRegionsURL { +func (o *ListRoutersURL) WithBasePath(bp string) *ListRoutersURL { o.SetBasePath(bp) return o } @@ -59,19 +59,19 @@ func (o *ListGeoRegionsURL) WithBasePath(bp string) *ListGeoRegionsURL { // 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 *ListGeoRegionsURL) SetBasePath(bp string) { +func (o *ListRoutersURL) SetBasePath(bp string) { o._basePath = bp } // Build a url path and query string -func (o *ListGeoRegionsURL) Build() (*url.URL, error) { +func (o *ListRoutersURL) Build() (*url.URL, error) { var _result url.URL - var _path = "/geo-regions" + var _path = "/routers" _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) @@ -107,7 +107,7 @@ func (o *ListGeoRegionsURL) Build() (*url.URL, error) { } // Must is a helper function to panic when the url builder returns an error -func (o *ListGeoRegionsURL) Must(u *url.URL, err error) *url.URL { +func (o *ListRoutersURL) Must(u *url.URL, err error) *url.URL { if err != nil { panic(err) } @@ -118,17 +118,17 @@ func (o *ListGeoRegionsURL) Must(u *url.URL, err error) *url.URL { } // String returns the string representation of the path with query string -func (o *ListGeoRegionsURL) String() 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 *ListGeoRegionsURL) BuildFull(scheme, host string) (*url.URL, error) { +func (o *ListRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListGeoRegionsURL") + 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 ListGeoRegionsURL") + return nil, errors.New("host is required for a full url on ListRoutersURL") } base, err := o.Build() @@ -142,6 +142,6 @@ func (o *ListGeoRegionsURL) BuildFull(scheme, host string) (*url.URL, error) { } // StringFull returns the string representation of a complete url -func (o *ListGeoRegionsURL) StringFull(scheme, host string) string { +func (o *ListRoutersURL) StringFull(scheme, host string) string { return o.Must(o.BuildFull(scheme, host)).String() } diff --git a/rest_server/operations/transit_router/list_transit_routers.go b/rest_management_api_server/operations/router/list_transit_routers.go similarity index 90% rename from rest_server/operations/transit_router/list_transit_routers.go rename to rest_management_api_server/operations/router/list_transit_routers.go index 70a72eb4a..02aa8c667 100644 --- a/rest_server/operations/transit_router/list_transit_routers.go +++ b/rest_management_api_server/operations/router/list_transit_routers.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewListTransitRouters(ctx *middleware.Context, handler ListTransitRoutersHa return &ListTransitRouters{Context: ctx, Handler: handler} } -/*ListTransitRouters swagger:route GET /transit-routers Transit Router listTransitRouters +/* ListTransitRouters swagger:route GET /transit-routers Router listTransitRouters -List transit routers +List routers -Retrieves a list of transit router resources; supports filtering, sorting, and pagination. Requires admin access. +Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. */ @@ -69,21 +69,20 @@ type ListTransitRouters struct { func (o *ListTransitRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListTransitRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/list_transit_routers_parameters.go b/rest_management_api_server/operations/router/list_transit_routers_parameters.go similarity index 98% rename from rest_server/operations/transit_router/list_transit_routers_parameters.go rename to rest_management_api_server/operations/router/list_transit_routers_parameters.go index 1b20aa090..b3238f023 100644 --- a/rest_server/operations/transit_router/list_transit_routers_parameters.go +++ b/rest_management_api_server/operations/router/list_transit_routers_parameters.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -40,7 +40,8 @@ import ( ) // NewListTransitRoutersParams creates a new ListTransitRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListTransitRoutersParams() ListTransitRoutersParams { return ListTransitRoutersParams{} @@ -94,7 +95,6 @@ func (o *ListTransitRoutersParams) BindRequest(r *http.Request, route *middlewar if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListTransitRoutersParams) bindFilter(rawData []string, hasKey bool, for // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListTransitRoutersParams) bindLimit(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListTransitRoutersParams) bindOffset(rawData []string, hasKey bool, for // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/transit_router/list_transit_routers_responses.go b/rest_management_api_server/operations/router/list_transit_routers_responses.go similarity index 95% rename from rest_server/operations/transit_router/list_transit_routers_responses.go rename to rest_management_api_server/operations/router/list_transit_routers_responses.go index 45ac95291..266c47bfe 100644 --- a/rest_server/operations/transit_router/list_transit_routers_responses.go +++ b/rest_management_api_server/operations/router/list_transit_routers_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -49,7 +49,7 @@ type ListTransitRoutersOK struct { /* In: Body */ - Payload *rest_model.ListTransitRoutersEnvelope `json:"body,omitempty"` + Payload *rest_model.ListRoutersEnvelope `json:"body,omitempty"` } // NewListTransitRoutersOK creates ListTransitRoutersOK with default headers values @@ -59,13 +59,13 @@ func NewListTransitRoutersOK() *ListTransitRoutersOK { } // WithPayload adds the payload to the list transit routers o k response -func (o *ListTransitRoutersOK) WithPayload(payload *rest_model.ListTransitRoutersEnvelope) *ListTransitRoutersOK { +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.ListTransitRoutersEnvelope) { +func (o *ListTransitRoutersOK) SetPayload(payload *rest_model.ListRoutersEnvelope) { o.Payload = payload } diff --git a/rest_server/operations/transit_router/list_transit_routers_urlbuilder.go b/rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/list_transit_routers_urlbuilder.go rename to rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go index ed1384c88..3d0ff8464 100644 --- a/rest_server/operations/transit_router/list_transit_routers_urlbuilder.go +++ b/rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -71,7 +71,7 @@ func (o *ListTransitRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/patch_router.go b/rest_management_api_server/operations/router/patch_router.go new file mode 100644 index 000000000..56f59942f --- /dev/null +++ b/rest_management_api_server/operations/router/patch_router.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..094d99cd1 --- /dev/null +++ b/rest_management_api_server/operations/router/patch_router_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..8bfca5f6c --- /dev/null +++ b/rest_management_api_server/operations/router/patch_router_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..33d6096c2 --- /dev/null +++ b/rest_management_api_server/operations/router/patch_router_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/transit_router/patch_transit_router.go b/rest_management_api_server/operations/router/patch_transit_router.go similarity index 90% rename from rest_server/operations/transit_router/patch_transit_router.go rename to rest_management_api_server/operations/router/patch_transit_router.go index 8964ea6ff..a9b9fe53a 100644 --- a/rest_server/operations/transit_router/patch_transit_router.go +++ b/rest_management_api_server/operations/router/patch_transit_router.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewPatchTransitRouter(ctx *middleware.Context, handler PatchTransitRouterHa return &PatchTransitRouter{Context: ctx, Handler: handler} } -/*PatchTransitRouter swagger:route PATCH /transit-routers/{id} Transit Router patchTransitRouter +/* PatchTransitRouter swagger:route PATCH /transit-routers/{id} Router patchTransitRouter -Update the supplied fields on a transit router +Update the supplied fields on a router -Update the supplied fields on a transit router. Requires admin access. +Update the supplied fields on a router. Requires admin access. */ type PatchTransitRouter struct { @@ -68,21 +68,20 @@ type PatchTransitRouter struct { func (o *PatchTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/patch_transit_router_parameters.go b/rest_management_api_server/operations/router/patch_transit_router_parameters.go similarity index 90% rename from rest_server/operations/transit_router/patch_transit_router_parameters.go rename to rest_management_api_server/operations/router/patch_transit_router_parameters.go index 96887795b..67cab36c4 100644 --- a/rest_server/operations/transit_router/patch_transit_router_parameters.go +++ b/rest_management_api_server/operations/router/patch_transit_router_parameters.go @@ -24,12 +24,13 @@ // __/ | // |___/ -package transit_router +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" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchTransitRouterParams() PatchTransitRouterParams { return PatchTransitRouterParams{} @@ -62,11 +65,11 @@ type PatchTransitRouterParams struct { In: path */ ID string - /*A transit router patch object + /*A router patch object Required: true In: body */ - Router *rest_model.TransitRouterPatch + Router *rest_model.RouterPatch } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -85,7 +88,7 @@ func (o *PatchTransitRouterParams) BindRequest(r *http.Request, route *middlewar if runtime.HasBody(r) { defer r.Body.Close() - var body rest_model.TransitRouterPatch + 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", "")) @@ -98,6 +101,11 @@ func (o *PatchTransitRouterParams) BindRequest(r *http.Request, route *middlewar 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 } @@ -120,7 +128,6 @@ func (o *PatchTransitRouterParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/transit_router/patch_transit_router_responses.go b/rest_management_api_server/operations/router/patch_transit_router_responses.go similarity index 99% rename from rest_server/operations/transit_router/patch_transit_router_responses.go rename to rest_management_api_server/operations/router/patch_transit_router_responses.go index c221ea72f..194d2c0ec 100644 --- a/rest_server/operations/transit_router/patch_transit_router_responses.go +++ b/rest_management_api_server/operations/router/patch_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/rest_server/operations/transit_router/patch_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/patch_transit_router_urlbuilder.go rename to rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go index 19fa49b0a..19572a1a6 100644 --- a/rest_server/operations/transit_router/patch_transit_router_urlbuilder.go +++ b/rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -75,7 +75,7 @@ func (o *PatchTransitRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/router/update_router.go b/rest_management_api_server/operations/router/update_router.go new file mode 100644 index 000000000..953c25966 --- /dev/null +++ b/rest_management_api_server/operations/router/update_router.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..368d8af87 --- /dev/null +++ b/rest_management_api_server/operations/router/update_router_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..e7aa57780 --- /dev/null +++ b/rest_management_api_server/operations/router/update_router_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..84be8ccbf --- /dev/null +++ b/rest_management_api_server/operations/router/update_router_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/transit_router/update_transit_router.go b/rest_management_api_server/operations/router/update_transit_router.go similarity index 90% rename from rest_server/operations/transit_router/update_transit_router.go rename to rest_management_api_server/operations/router/update_transit_router.go index 139c4b73f..2f45ec606 100644 --- a/rest_server/operations/transit_router/update_transit_router.go +++ b/rest_management_api_server/operations/router/update_transit_router.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -53,11 +53,11 @@ func NewUpdateTransitRouter(ctx *middleware.Context, handler UpdateTransitRouter return &UpdateTransitRouter{Context: ctx, Handler: handler} } -/*UpdateTransitRouter swagger:route PUT /transit-routers/{id} Transit Router updateTransitRouter +/* UpdateTransitRouter swagger:route PUT /transit-routers/{id} Router updateTransitRouter -Update all fields on a transit router +Update all fields on a router -Update all fields on a transit router by id. Requires admin access. +Update all fields on a router by id. Requires admin access. */ type UpdateTransitRouter struct { @@ -68,21 +68,20 @@ type UpdateTransitRouter struct { func (o *UpdateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/transit_router/update_transit_router_parameters.go b/rest_management_api_server/operations/router/update_transit_router_parameters.go similarity index 90% rename from rest_server/operations/transit_router/update_transit_router_parameters.go rename to rest_management_api_server/operations/router/update_transit_router_parameters.go index 224ea8856..b8c1a3e8d 100644 --- a/rest_server/operations/transit_router/update_transit_router_parameters.go +++ b/rest_management_api_server/operations/router/update_transit_router_parameters.go @@ -24,12 +24,13 @@ // __/ | // |___/ -package transit_router +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" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateTransitRouterParams() UpdateTransitRouterParams { return UpdateTransitRouterParams{} @@ -62,11 +65,11 @@ type UpdateTransitRouterParams struct { In: path */ ID string - /*A transit router update object + /*A router update object Required: true In: body */ - Router *rest_model.TransitRouterUpdate + Router *rest_model.RouterUpdate } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -85,7 +88,7 @@ func (o *UpdateTransitRouterParams) BindRequest(r *http.Request, route *middlewa if runtime.HasBody(r) { defer r.Body.Close() - var body rest_model.TransitRouterUpdate + 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", "")) @@ -98,6 +101,11 @@ func (o *UpdateTransitRouterParams) BindRequest(r *http.Request, route *middlewa 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 } @@ -120,7 +128,6 @@ func (o *UpdateTransitRouterParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/transit_router/update_transit_router_responses.go b/rest_management_api_server/operations/router/update_transit_router_responses.go similarity index 99% rename from rest_server/operations/transit_router/update_transit_router_responses.go rename to rest_management_api_server/operations/router/update_transit_router_responses.go index d0727b001..184e46cc7 100644 --- a/rest_server/operations/transit_router/update_transit_router_responses.go +++ b/rest_management_api_server/operations/router/update_transit_router_responses.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/rest_server/operations/transit_router/update_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/update_transit_router_urlbuilder.go similarity index 98% rename from rest_server/operations/transit_router/update_transit_router_urlbuilder.go rename to rest_management_api_server/operations/router/update_transit_router_urlbuilder.go index 16af975c0..f4bb57172 100644 --- a/rest_server/operations/transit_router/update_transit_router_urlbuilder.go +++ b/rest_management_api_server/operations/router/update_transit_router_urlbuilder.go @@ -24,7 +24,7 @@ // __/ | // |___/ -package transit_router +package router // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -75,7 +75,7 @@ func (o *UpdateTransitRouterURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/create_service.go b/rest_management_api_server/operations/service/create_service.go similarity index 94% rename from rest_server/operations/service/create_service.go rename to rest_management_api_server/operations/service/create_service.go index a1533c1b4..ecd6b83eb 100644 --- a/rest_server/operations/service/create_service.go +++ b/rest_management_api_server/operations/service/create_service.go @@ -53,7 +53,7 @@ func NewCreateService(ctx *middleware.Context, handler CreateServiceHandler) *Cr return &CreateService{Context: ctx, Handler: handler} } -/*CreateService swagger:route POST /services Service createService +/* CreateService swagger:route POST /services Service createService Create a services resource @@ -68,21 +68,20 @@ type CreateService struct { func (o *CreateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/create_service_parameters.go b/rest_management_api_server/operations/service/create_service_parameters.go similarity index 91% rename from rest_server/operations/service/create_service_parameters.go rename to rest_management_api_server/operations/service/create_service_parameters.go index ecc5493e9..8f4164607 100644 --- a/rest_server/operations/service/create_service_parameters.go +++ b/rest_management_api_server/operations/service/create_service_parameters.go @@ -30,18 +30,21 @@ package service // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateServiceParams() CreateServiceParams { return CreateServiceParams{} @@ -87,6 +90,11 @@ func (o *CreateServiceParams) BindRequest(r *http.Request, route *middleware.Mat 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 } diff --git a/rest_server/operations/service/create_service_responses.go b/rest_management_api_server/operations/service/create_service_responses.go similarity index 100% rename from rest_server/operations/service/create_service_responses.go rename to rest_management_api_server/operations/service/create_service_responses.go diff --git a/rest_server/operations/service/create_service_urlbuilder.go b/rest_management_api_server/operations/service/create_service_urlbuilder.go similarity index 98% rename from rest_server/operations/service/create_service_urlbuilder.go rename to rest_management_api_server/operations/service/create_service_urlbuilder.go index 03c17cf5a..7ff6b46c4 100644 --- a/rest_server/operations/service/create_service_urlbuilder.go +++ b/rest_management_api_server/operations/service/create_service_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateServiceURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/service/delete_service.go b/rest_management_api_server/operations/service/delete_service.go new file mode 100644 index 000000000..b1f007b17 --- /dev/null +++ b/rest_management_api_server/operations/service/delete_service.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b58e95631 --- /dev/null +++ b/rest_management_api_server/operations/service/delete_service_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..48e49e903 --- /dev/null +++ b/rest_management_api_server/operations/service/delete_service_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f8f86e1de --- /dev/null +++ b/rest_management_api_server/operations/service/delete_service_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..3516cfb7c --- /dev/null +++ b/rest_management_api_server/operations/service/detail_service.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c7baaf646 --- /dev/null +++ b/rest_management_api_server/operations/service/detail_service_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..beffbebad --- /dev/null +++ b/rest_management_api_server/operations/service/detail_service_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..58359e8fa --- /dev/null +++ b/rest_management_api_server/operations/service/detail_service_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/service/list_service_config.go b/rest_management_api_server/operations/service/list_service_config.go similarity index 94% rename from rest_server/operations/service/list_service_config.go rename to rest_management_api_server/operations/service/list_service_config.go index c3ea9f9f1..a110bb69b 100644 --- a/rest_server/operations/service/list_service_config.go +++ b/rest_management_api_server/operations/service/list_service_config.go @@ -53,7 +53,7 @@ func NewListServiceConfig(ctx *middleware.Context, handler ListServiceConfigHand return &ListServiceConfig{Context: ctx, Handler: handler} } -/*ListServiceConfig swagger:route GET /services/{id}/configs Service listServiceConfig +/* ListServiceConfig swagger:route GET /services/{id}/configs Service listServiceConfig List configs associated to a specific service @@ -69,21 +69,20 @@ type ListServiceConfig struct { func (o *ListServiceConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_service_config_parameters.go b/rest_management_api_server/operations/service/list_service_config_parameters.go similarity index 98% rename from rest_server/operations/service/list_service_config_parameters.go rename to rest_management_api_server/operations/service/list_service_config_parameters.go index 5abbe68ff..61484ef31 100644 --- a/rest_server/operations/service/list_service_config_parameters.go +++ b/rest_management_api_server/operations/service/list_service_config_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceConfigParams creates a new ListServiceConfigParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceConfigParams() ListServiceConfigParams { return ListServiceConfigParams{} @@ -104,7 +105,6 @@ func (o *ListServiceConfigParams) BindRequest(r *http.Request, route *middleware if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceConfigParams) bindFilter(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceConfigParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceConfigParams) bindLimit(rawData []string, hasKey bool, forma // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceConfigParams) bindOffset(rawData []string, hasKey bool, form // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service/list_service_config_responses.go b/rest_management_api_server/operations/service/list_service_config_responses.go similarity index 100% rename from rest_server/operations/service/list_service_config_responses.go rename to rest_management_api_server/operations/service/list_service_config_responses.go diff --git a/rest_server/operations/service/list_service_config_urlbuilder.go b/rest_management_api_server/operations/service/list_service_config_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_service_config_urlbuilder.go rename to rest_management_api_server/operations/service/list_service_config_urlbuilder.go index 92cbc2665..3e1df63c6 100644 --- a/rest_server/operations/service/list_service_config_urlbuilder.go +++ b/rest_management_api_server/operations/service/list_service_config_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServiceConfigURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_service_edge_routers.go b/rest_management_api_server/operations/service/list_service_edge_routers.go similarity index 93% rename from rest_server/operations/service/list_service_edge_routers.go rename to rest_management_api_server/operations/service/list_service_edge_routers.go index 1d269d2b1..75c26bae8 100644 --- a/rest_server/operations/service/list_service_edge_routers.go +++ b/rest_management_api_server/operations/service/list_service_edge_routers.go @@ -53,7 +53,7 @@ func NewListServiceEdgeRouters(ctx *middleware.Context, handler ListServiceEdgeR return &ListServiceEdgeRouters{Context: ctx, Handler: handler} } -/*ListServiceEdgeRouters swagger:route GET /services/{id}/edge-routers Service listServiceEdgeRouters +/* ListServiceEdgeRouters swagger:route GET /services/{id}/edge-routers Service listServiceEdgeRouters List accessible edge-routers @@ -69,21 +69,20 @@ type ListServiceEdgeRouters struct { func (o *ListServiceEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_service_edge_routers_parameters.go b/rest_management_api_server/operations/service/list_service_edge_routers_parameters.go similarity index 98% rename from rest_server/operations/service/list_service_edge_routers_parameters.go rename to rest_management_api_server/operations/service/list_service_edge_routers_parameters.go index 1724ff197..5c3c3c826 100644 --- a/rest_server/operations/service/list_service_edge_routers_parameters.go +++ b/rest_management_api_server/operations/service/list_service_edge_routers_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceEdgeRoutersParams creates a new ListServiceEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceEdgeRoutersParams() ListServiceEdgeRoutersParams { return ListServiceEdgeRoutersParams{} @@ -104,7 +105,6 @@ func (o *ListServiceEdgeRoutersParams) BindRequest(r *http.Request, route *middl if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceEdgeRoutersParams) bindFilter(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceEdgeRoutersParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceEdgeRoutersParams) bindLimit(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceEdgeRoutersParams) bindOffset(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service/list_service_edge_routers_responses.go b/rest_management_api_server/operations/service/list_service_edge_routers_responses.go similarity index 100% rename from rest_server/operations/service/list_service_edge_routers_responses.go rename to rest_management_api_server/operations/service/list_service_edge_routers_responses.go diff --git a/rest_server/operations/service/list_service_edge_routers_urlbuilder.go b/rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_service_edge_routers_urlbuilder.go rename to rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go index 5ac1a1414..f48973f59 100644 --- a/rest_server/operations/service/list_service_edge_routers_urlbuilder.go +++ b/rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServiceEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_service_identities.go b/rest_management_api_server/operations/service/list_service_identities.go similarity index 93% rename from rest_server/operations/service/list_service_identities.go rename to rest_management_api_server/operations/service/list_service_identities.go index e3c04c3ae..35d22c551 100644 --- a/rest_server/operations/service/list_service_identities.go +++ b/rest_management_api_server/operations/service/list_service_identities.go @@ -53,7 +53,7 @@ func NewListServiceIdentities(ctx *middleware.Context, handler ListServiceIdenti return &ListServiceIdentities{Context: ctx, Handler: handler} } -/*ListServiceIdentities swagger:route GET /services/{id}/identities Service listServiceIdentities +/* ListServiceIdentities swagger:route GET /services/{id}/identities Service listServiceIdentities List identities with access @@ -69,21 +69,20 @@ type ListServiceIdentities struct { func (o *ListServiceIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Reques } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_service_identities_parameters.go b/rest_management_api_server/operations/service/list_service_identities_parameters.go similarity index 98% rename from rest_server/operations/service/list_service_identities_parameters.go rename to rest_management_api_server/operations/service/list_service_identities_parameters.go index d33e3bfd7..36bc75def 100644 --- a/rest_server/operations/service/list_service_identities_parameters.go +++ b/rest_management_api_server/operations/service/list_service_identities_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceIdentitiesParams creates a new ListServiceIdentitiesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceIdentitiesParams() ListServiceIdentitiesParams { return ListServiceIdentitiesParams{} @@ -104,7 +105,6 @@ func (o *ListServiceIdentitiesParams) BindRequest(r *http.Request, route *middle if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceIdentitiesParams) bindFilter(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceIdentitiesParams) bindID(rawData []string, hasKey bool, form // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceIdentitiesParams) bindLimit(rawData []string, hasKey bool, f // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceIdentitiesParams) bindOffset(rawData []string, hasKey bool, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service/list_service_identities_responses.go b/rest_management_api_server/operations/service/list_service_identities_responses.go similarity index 100% rename from rest_server/operations/service/list_service_identities_responses.go rename to rest_management_api_server/operations/service/list_service_identities_responses.go diff --git a/rest_server/operations/service/list_service_identities_urlbuilder.go b/rest_management_api_server/operations/service/list_service_identities_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_service_identities_urlbuilder.go rename to rest_management_api_server/operations/service/list_service_identities_urlbuilder.go index cf5c667cc..ce6c36d8b 100644 --- a/rest_server/operations/service/list_service_identities_urlbuilder.go +++ b/rest_management_api_server/operations/service/list_service_identities_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServiceIdentitiesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_service_service_edge_router_policies.go b/rest_management_api_server/operations/service/list_service_service_edge_router_policies.go similarity index 93% rename from rest_server/operations/service/list_service_service_edge_router_policies.go rename to rest_management_api_server/operations/service/list_service_service_edge_router_policies.go index 0939c1b29..14483fd01 100644 --- a/rest_server/operations/service/list_service_service_edge_router_policies.go +++ b/rest_management_api_server/operations/service/list_service_service_edge_router_policies.go @@ -53,7 +53,7 @@ func NewListServiceServiceEdgeRouterPolicies(ctx *middleware.Context, handler Li return &ListServiceServiceEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListServiceServiceEdgeRouterPolicies swagger:route GET /services/{id}/service-edge-router-policies Service listServiceServiceEdgeRouterPolicies +/* ListServiceServiceEdgeRouterPolicies swagger:route GET /services/{id}/service-edge-router-policies Service listServiceServiceEdgeRouterPolicies List service edge router policies that affect a specific service @@ -69,21 +69,20 @@ type ListServiceServiceEdgeRouterPolicies struct { func (o *ListServiceServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service/list_service_service_edge_router_policies_parameters.go rename to rest_management_api_server/operations/service/list_service_service_edge_router_policies_parameters.go index 85e2a5106..710fab7b6 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListServiceServiceEdgeRouterPoliciesParams creates a new ListServiceServiceEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceServiceEdgeRouterPoliciesParams() ListServiceServiceEdgeRouterPoliciesParams { return ListServiceServiceEdgeRouterPoliciesParams{} @@ -104,7 +105,6 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) BindRequest(r *http.Request if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) bindFilter(rawData []string // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) bindID(rawData []string, ha // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) bindLimit(rawData []string, // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceServiceEdgeRouterPoliciesParams) bindOffset(rawData []string // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service/list_service_service_edge_router_policies_responses.go rename to rest_management_api_server/operations/service/list_service_service_edge_router_policies_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service/list_service_service_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/service/list_service_service_edge_router_policies_urlbuilder.go index cf915c4d4..e332c7e52 100644 --- a/rest_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 @@ -81,7 +81,7 @@ func (o *ListServiceServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service/list_service_service_policies.go b/rest_management_api_server/operations/service/list_service_service_policies.go similarity index 93% rename from rest_server/operations/service/list_service_service_policies.go rename to rest_management_api_server/operations/service/list_service_service_policies.go index 2a1c43fe7..347428a1e 100644 --- a/rest_server/operations/service/list_service_service_policies.go +++ b/rest_management_api_server/operations/service/list_service_service_policies.go @@ -53,7 +53,7 @@ func NewListServiceServicePolicies(ctx *middleware.Context, handler ListServiceS return &ListServiceServicePolicies{Context: ctx, Handler: handler} } -/*ListServiceServicePolicies swagger:route GET /services/{id}/service-policies Service listServiceServicePolicies +/* ListServiceServicePolicies swagger:route GET /services/{id}/service-policies Service listServiceServicePolicies List service policies that affect a specific service @@ -69,21 +69,20 @@ type ListServiceServicePolicies struct { func (o *ListServiceServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.R } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service/list_service_service_policies_parameters.go b/rest_management_api_server/operations/service/list_service_service_policies_parameters.go similarity index 98% rename from rest_server/operations/service/list_service_service_policies_parameters.go rename to rest_management_api_server/operations/service/list_service_service_policies_parameters.go index e49d1a732..d8548253a 100644 --- a/rest_server/operations/service/list_service_service_policies_parameters.go +++ b/rest_management_api_server/operations/service/list_service_service_policies_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServiceServicePoliciesParams creates a new ListServiceServicePoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceServicePoliciesParams() ListServiceServicePoliciesParams { return ListServiceServicePoliciesParams{} @@ -104,7 +105,6 @@ func (o *ListServiceServicePoliciesParams) BindRequest(r *http.Request, route *m if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServiceServicePoliciesParams) bindFilter(rawData []string, hasKey b // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServiceServicePoliciesParams) bindID(rawData []string, hasKey bool, // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServiceServicePoliciesParams) bindLimit(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServiceServicePoliciesParams) bindOffset(rawData []string, hasKey b // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service/list_service_service_policies_responses.go b/rest_management_api_server/operations/service/list_service_service_policies_responses.go similarity index 100% rename from rest_server/operations/service/list_service_service_policies_responses.go rename to rest_management_api_server/operations/service/list_service_service_policies_responses.go diff --git a/rest_server/operations/service/list_service_service_policies_urlbuilder.go b/rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go similarity index 99% rename from rest_server/operations/service/list_service_service_policies_urlbuilder.go rename to rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go index d50132e27..56f5fd009 100644 --- a/rest_server/operations/service/list_service_service_policies_urlbuilder.go +++ b/rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServiceServicePoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/service/list_service_terminators.go b/rest_management_api_server/operations/service/list_service_terminators.go new file mode 100644 index 000000000..d668d4cd2 --- /dev/null +++ b/rest_management_api_server/operations/service/list_service_terminators.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..b7d66e76b --- /dev/null +++ b/rest_management_api_server/operations/service/list_service_terminators_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/service/list_service_terminators_responses.go b/rest_management_api_server/operations/service/list_service_terminators_responses.go similarity index 100% rename from rest_server/operations/service/list_service_terminators_responses.go rename to rest_management_api_server/operations/service/list_service_terminators_responses.go 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 new file mode 100644 index 000000000..708198e1f --- /dev/null +++ b/rest_management_api_server/operations/service/list_service_terminators_urlbuilder.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..f8b48a763 --- /dev/null +++ b/rest_management_api_server/operations/service/list_services.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c69cc57e6 --- /dev/null +++ b/rest_management_api_server/operations/service/list_services_parameters.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..00a8f1bf7 --- /dev/null +++ b/rest_management_api_server/operations/service/list_services_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + } + } +} + +// 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 new file mode 100644 index 000000000..ea70a380a --- /dev/null +++ b/rest_management_api_server/operations/service/list_services_urlbuilder.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..fcf15a412 --- /dev/null +++ b/rest_management_api_server/operations/service/patch_service.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..c75558144 --- /dev/null +++ b/rest_management_api_server/operations/service/patch_service_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..8521812af --- /dev/null +++ b/rest_management_api_server/operations/service/patch_service_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..5a6884432 --- /dev/null +++ b/rest_management_api_server/operations/service/patch_service_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..43a4acd89 --- /dev/null +++ b/rest_management_api_server/operations/service/update_service.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..6d8aacc72 --- /dev/null +++ b/rest_management_api_server/operations/service/update_service_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..4b48127e4 --- /dev/null +++ b/rest_management_api_server/operations/service/update_service_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..334a74b69 --- /dev/null +++ b/rest_management_api_server/operations/service/update_service_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_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 similarity index 93% rename from rest_server/operations/service_edge_router_policy/create_service_edge_router_policy.go rename to rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy.go index 86b05d85b..ed51abbda 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewCreateServiceEdgeRouterPolicy(ctx *middleware.Context, handler CreateSer return &CreateServiceEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*CreateServiceEdgeRouterPolicy swagger:route POST /service-edge-router-policies Service Edge Router Policy createServiceEdgeRouterPolicy +/* CreateServiceEdgeRouterPolicy swagger:route POST /service-edge-router-policies Service Edge Router Policy createServiceEdgeRouterPolicy Create a service edge router policy resource @@ -68,21 +68,20 @@ type CreateServiceEdgeRouterPolicy struct { func (o *CreateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go index 882b371a2..f971788dd 100644 --- a/rest_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 @@ -30,18 +30,21 @@ package service_edge_router_policy // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateServiceEdgeRouterPolicyParams() CreateServiceEdgeRouterPolicyParams { return CreateServiceEdgeRouterPolicyParams{} @@ -87,6 +90,11 @@ func (o *CreateServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route 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 } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go index fe15ae234..9a70265dd 100644 --- a/rest_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 @@ -63,7 +63,7 @@ func (o *CreateServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/delete_service_edge_router_policy.go rename to rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy.go index 98c8898a7..9d5aa0299 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewDeleteServiceEdgeRouterPolicy(ctx *middleware.Context, handler DeleteSer return &DeleteServiceEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*DeleteServiceEdgeRouterPolicy swagger:route DELETE /service-edge-router-policies/{id} Service Edge Router Policy deleteServiceEdgeRouterPolicy +/* DeleteServiceEdgeRouterPolicy swagger:route DELETE /service-edge-router-policies/{id} Service Edge Router Policy deleteServiceEdgeRouterPolicy Delete a service edge policy @@ -68,21 +68,20 @@ type DeleteServiceEdgeRouterPolicy struct { func (o *DeleteServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go index 808efe0a7..a1ac27958 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDeleteServiceEdgeRouterPolicyParams creates a new DeleteServiceEdgeRouterPolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteServiceEdgeRouterPolicyParams() DeleteServiceEdgeRouterPolicyParams { return DeleteServiceEdgeRouterPolicyParams{} @@ -73,7 +74,6 @@ func (o *DeleteServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go index 76e75fb42..f83c64beb 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DeleteServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/detail_service_edge_router_policy.go rename to rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy.go index 42d44b779..9709322f9 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewDetailServiceEdgeRouterPolicy(ctx *middleware.Context, handler DetailSer return &DetailServiceEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*DetailServiceEdgeRouterPolicy swagger:route GET /service-edge-router-policies/{id} Service Edge Router Policy detailServiceEdgeRouterPolicy +/* DetailServiceEdgeRouterPolicy swagger:route GET /service-edge-router-policies/{id} Service Edge Router Policy detailServiceEdgeRouterPolicy Retrieves a single service edge policy @@ -68,21 +68,20 @@ type DetailServiceEdgeRouterPolicy struct { func (o *DetailServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go index eabde78e8..94dbd220f 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewDetailServiceEdgeRouterPolicyParams creates a new DetailServiceEdgeRouterPolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailServiceEdgeRouterPolicyParams() DetailServiceEdgeRouterPolicyParams { return DetailServiceEdgeRouterPolicyParams{} @@ -73,7 +74,6 @@ func (o *DetailServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go index d77008473..a149a2de2 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *DetailServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policies.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies.go index 20b091816..693a15efb 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListServiceEdgeRouterPolicies(ctx *middleware.Context, handler ListServi return &ListServiceEdgeRouterPolicies{Context: ctx, Handler: handler} } -/*ListServiceEdgeRouterPolicies swagger:route GET /service-edge-router-policies Service Edge Router Policy listServiceEdgeRouterPolicies +/* ListServiceEdgeRouterPolicies swagger:route GET /service-edge-router-policies Service Edge Router Policy listServiceEdgeRouterPolicies List service edge router policies @@ -69,21 +69,20 @@ type ListServiceEdgeRouterPolicies struct { func (o *ListServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go index b138092c1..9e18a44bf 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListServiceEdgeRouterPoliciesParams creates a new ListServiceEdgeRouterPoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceEdgeRouterPoliciesParams() ListServiceEdgeRouterPoliciesParams { return ListServiceEdgeRouterPoliciesParams{} @@ -94,7 +95,6 @@ func (o *ListServiceEdgeRouterPoliciesParams) BindRequest(r *http.Request, route if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListServiceEdgeRouterPoliciesParams) bindFilter(rawData []string, hasKe // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListServiceEdgeRouterPoliciesParams) bindLimit(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListServiceEdgeRouterPoliciesParams) bindOffset(rawData []string, hasKe // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go index 18ac6223f..d3308515e 100644 --- a/rest_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 @@ -71,7 +71,7 @@ func (o *ListServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go index eb66b44ed..4cb627b88 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListServiceEdgeRouterPolicyEdgeRouters(ctx *middleware.Context, handler return &ListServiceEdgeRouterPolicyEdgeRouters{Context: ctx, Handler: handler} } -/*ListServiceEdgeRouterPolicyEdgeRouters swagger:route GET /service-edge-router-policies/{id}/edge-routers Service Edge Router Policy listServiceEdgeRouterPolicyEdgeRouters +/* 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 @@ -68,21 +68,20 @@ type ListServiceEdgeRouterPolicyEdgeRouters struct { func (o *ListServiceEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListServiceEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWrite } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go index e8bb8b0d1..127fd0b76 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListServiceEdgeRouterPolicyEdgeRoutersParams creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceEdgeRouterPolicyEdgeRoutersParams() ListServiceEdgeRouterPolicyEdgeRoutersParams { return ListServiceEdgeRouterPolicyEdgeRoutersParams{} @@ -73,7 +74,6 @@ func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) BindRequest(r *http.Reque if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) bindID(rawData []string, // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go index 30e35a647..9145bb73b 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_services.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services.go index b66a0bb4d..de9fa4576 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewListServiceEdgeRouterPolicyServices(ctx *middleware.Context, handler Lis return &ListServiceEdgeRouterPolicyServices{Context: ctx, Handler: handler} } -/*ListServiceEdgeRouterPolicyServices swagger:route GET /service-edge-router-policies/{id}/services Service Edge Router Policy listServiceEdgeRouterPolicyServices +/* 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 @@ -68,21 +68,20 @@ type ListServiceEdgeRouterPolicyServices struct { func (o *ListServiceEdgeRouterPolicyServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *ListServiceEdgeRouterPolicyServices) ServeHTTP(rw http.ResponseWriter, } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go index 93c2b4df6..1446df6e4 100644 --- a/rest_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 @@ -38,7 +38,8 @@ import ( ) // NewListServiceEdgeRouterPolicyServicesParams creates a new ListServiceEdgeRouterPolicyServicesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServiceEdgeRouterPolicyServicesParams() ListServiceEdgeRouterPolicyServicesParams { return ListServiceEdgeRouterPolicyServicesParams{} @@ -73,7 +74,6 @@ func (o *ListServiceEdgeRouterPolicyServicesParams) BindRequest(r *http.Request, if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *ListServiceEdgeRouterPolicyServicesParams) bindID(rawData []string, has // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go index 566da1efd..e371ef250 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *ListServiceEdgeRouterPolicyServicesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 92% rename from rest_server/operations/service_edge_router_policy/patch_service_edge_router_policy.go rename to rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy.go index d19c88367..a10e2a8c7 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewPatchServiceEdgeRouterPolicy(ctx *middleware.Context, handler PatchServi return &PatchServiceEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*PatchServiceEdgeRouterPolicy swagger:route PATCH /service-edge-router-policies/{id} Service Edge Router Policy patchServiceEdgeRouterPolicy +/* PatchServiceEdgeRouterPolicy swagger:route PATCH /service-edge-router-policies/{id} Service Edge Router Policy patchServiceEdgeRouterPolicy Update the supplied fields on a service edge policy @@ -68,21 +68,20 @@ type PatchServiceEdgeRouterPolicy struct { func (o *PatchServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go index 63a025795..cc400d2b4 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package service_edge_router_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchServiceEdgeRouterPolicyParams() PatchServiceEdgeRouterPolicyParams { return PatchServiceEdgeRouterPolicyParams{} @@ -98,6 +101,11 @@ func (o *PatchServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route 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 } @@ -120,7 +128,6 @@ func (o *PatchServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey boo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go index 0eeec9bfb..7e867e2e1 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *PatchServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_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 similarity index 93% rename from rest_server/operations/service_edge_router_policy/update_service_edge_router_policy.go rename to rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy.go index 5f190c1f6..d6a0e699e 100644 --- a/rest_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 @@ -53,7 +53,7 @@ func NewUpdateServiceEdgeRouterPolicy(ctx *middleware.Context, handler UpdateSer return &UpdateServiceEdgeRouterPolicy{Context: ctx, Handler: handler} } -/*UpdateServiceEdgeRouterPolicy swagger:route PUT /service-edge-router-policies/{id} Service Edge Router Policy updateServiceEdgeRouterPolicy +/* UpdateServiceEdgeRouterPolicy swagger:route PUT /service-edge-router-policies/{id} Service Edge Router Policy updateServiceEdgeRouterPolicy Update all fields on a service edge policy @@ -68,21 +68,20 @@ type UpdateServiceEdgeRouterPolicy struct { func (o *UpdateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *htt } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 93% rename from rest_server/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go rename to rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go index abad4726d..3727759c6 100644 --- a/rest_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 @@ -30,6 +30,7 @@ package service_edge_router_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateServiceEdgeRouterPolicyParams() UpdateServiceEdgeRouterPolicyParams { return UpdateServiceEdgeRouterPolicyParams{} @@ -98,6 +101,11 @@ func (o *UpdateServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route 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 } @@ -120,7 +128,6 @@ func (o *UpdateServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bo // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go rename to rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go rename to rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go index 255d5cdc6..8e99f7737 100644 --- a/rest_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 @@ -75,7 +75,7 @@ func (o *UpdateServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/create_service_policy.go b/rest_management_api_server/operations/service_policy/create_service_policy.go similarity index 93% rename from rest_server/operations/service_policy/create_service_policy.go rename to rest_management_api_server/operations/service_policy/create_service_policy.go index 0671c220f..8049c7492 100644 --- a/rest_server/operations/service_policy/create_service_policy.go +++ b/rest_management_api_server/operations/service_policy/create_service_policy.go @@ -53,7 +53,7 @@ func NewCreateServicePolicy(ctx *middleware.Context, handler CreateServicePolicy return &CreateServicePolicy{Context: ctx, Handler: handler} } -/*CreateServicePolicy swagger:route POST /service-policies Service Policy createServicePolicy +/* CreateServicePolicy swagger:route POST /service-policies Service Policy createServicePolicy Create a service policy resource @@ -68,21 +68,20 @@ type CreateServicePolicy struct { func (o *CreateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/create_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/create_service_policy_parameters.go similarity index 92% rename from rest_server/operations/service_policy/create_service_policy_parameters.go rename to rest_management_api_server/operations/service_policy/create_service_policy_parameters.go index 8144d319b..3cbb09aaf 100644 --- a/rest_server/operations/service_policy/create_service_policy_parameters.go +++ b/rest_management_api_server/operations/service_policy/create_service_policy_parameters.go @@ -30,18 +30,21 @@ package service_policy // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateServicePolicyParams() CreateServicePolicyParams { return CreateServicePolicyParams{} @@ -87,6 +90,11 @@ func (o *CreateServicePolicyParams) BindRequest(r *http.Request, route *middlewa 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 } diff --git a/rest_server/operations/service_policy/create_service_policy_responses.go b/rest_management_api_server/operations/service_policy/create_service_policy_responses.go similarity index 100% rename from rest_server/operations/service_policy/create_service_policy_responses.go rename to rest_management_api_server/operations/service_policy/create_service_policy_responses.go diff --git a/rest_server/operations/service_policy/create_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go similarity index 98% rename from rest_server/operations/service_policy/create_service_policy_urlbuilder.go rename to rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go index 24947c5d8..1b6ddc56f 100644 --- a/rest_server/operations/service_policy/create_service_policy_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateServicePolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/delete_service_policy.go b/rest_management_api_server/operations/service_policy/delete_service_policy.go similarity index 93% rename from rest_server/operations/service_policy/delete_service_policy.go rename to rest_management_api_server/operations/service_policy/delete_service_policy.go index ea274133e..ace2e7dca 100644 --- a/rest_server/operations/service_policy/delete_service_policy.go +++ b/rest_management_api_server/operations/service_policy/delete_service_policy.go @@ -53,7 +53,7 @@ func NewDeleteServicePolicy(ctx *middleware.Context, handler DeleteServicePolicy return &DeleteServicePolicy{Context: ctx, Handler: handler} } -/*DeleteServicePolicy swagger:route DELETE /service-policies/{id} Service Policy deleteServicePolicy +/* DeleteServicePolicy swagger:route DELETE /service-policies/{id} Service Policy deleteServicePolicy Delete a service policy @@ -68,21 +68,20 @@ type DeleteServicePolicy struct { func (o *DeleteServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/delete_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go similarity index 98% rename from rest_server/operations/service_policy/delete_service_policy_parameters.go rename to rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go index ee9acfffb..1dbe67b9b 100644 --- a/rest_server/operations/service_policy/delete_service_policy_parameters.go +++ b/rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteServicePolicyParams creates a new DeleteServicePolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteServicePolicyParams() DeleteServicePolicyParams { return DeleteServicePolicyParams{} @@ -73,7 +74,6 @@ func (o *DeleteServicePolicyParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteServicePolicyParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service_policy/delete_service_policy_responses.go b/rest_management_api_server/operations/service_policy/delete_service_policy_responses.go similarity index 100% rename from rest_server/operations/service_policy/delete_service_policy_responses.go rename to rest_management_api_server/operations/service_policy/delete_service_policy_responses.go diff --git a/rest_server/operations/service_policy/delete_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/delete_service_policy_urlbuilder.go rename to rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go index 1f7448bfa..5d51d3828 100644 --- a/rest_server/operations/service_policy/delete_service_policy_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteServicePolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/detail_service_policy.go b/rest_management_api_server/operations/service_policy/detail_service_policy.go similarity index 93% rename from rest_server/operations/service_policy/detail_service_policy.go rename to rest_management_api_server/operations/service_policy/detail_service_policy.go index 3da8546f7..f7dc05f90 100644 --- a/rest_server/operations/service_policy/detail_service_policy.go +++ b/rest_management_api_server/operations/service_policy/detail_service_policy.go @@ -53,7 +53,7 @@ func NewDetailServicePolicy(ctx *middleware.Context, handler DetailServicePolicy return &DetailServicePolicy{Context: ctx, Handler: handler} } -/*DetailServicePolicy swagger:route GET /service-policies/{id} Service Policy detailServicePolicy +/* DetailServicePolicy swagger:route GET /service-policies/{id} Service Policy detailServicePolicy Retrieves a single service policy @@ -68,21 +68,20 @@ type DetailServicePolicy struct { func (o *DetailServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/detail_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go similarity index 98% rename from rest_server/operations/service_policy/detail_service_policy_parameters.go rename to rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go index b61398a54..e94c3f90c 100644 --- a/rest_server/operations/service_policy/detail_service_policy_parameters.go +++ b/rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailServicePolicyParams creates a new DetailServicePolicyParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailServicePolicyParams() DetailServicePolicyParams { return DetailServicePolicyParams{} @@ -73,7 +74,6 @@ func (o *DetailServicePolicyParams) BindRequest(r *http.Request, route *middlewa if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailServicePolicyParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service_policy/detail_service_policy_responses.go b/rest_management_api_server/operations/service_policy/detail_service_policy_responses.go similarity index 100% rename from rest_server/operations/service_policy/detail_service_policy_responses.go rename to rest_management_api_server/operations/service_policy/detail_service_policy_responses.go diff --git a/rest_server/operations/service_policy/detail_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/detail_service_policy_urlbuilder.go rename to rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go index 1acc17c76..b5486496e 100644 --- a/rest_server/operations/service_policy/detail_service_policy_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailServicePolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/list_service_policies.go b/rest_management_api_server/operations/service_policy/list_service_policies.go similarity index 93% rename from rest_server/operations/service_policy/list_service_policies.go rename to rest_management_api_server/operations/service_policy/list_service_policies.go index 0052de709..645a831e3 100644 --- a/rest_server/operations/service_policy/list_service_policies.go +++ b/rest_management_api_server/operations/service_policy/list_service_policies.go @@ -53,7 +53,7 @@ func NewListServicePolicies(ctx *middleware.Context, handler ListServicePolicies return &ListServicePolicies{Context: ctx, Handler: handler} } -/*ListServicePolicies swagger:route GET /service-policies Service Policy listServicePolicies +/* ListServicePolicies swagger:route GET /service-policies Service Policy listServicePolicies List service policies @@ -69,21 +69,20 @@ type ListServicePolicies struct { func (o *ListServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/list_service_policies_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policies_parameters.go similarity index 98% rename from rest_server/operations/service_policy/list_service_policies_parameters.go rename to rest_management_api_server/operations/service_policy/list_service_policies_parameters.go index e49c98da7..fa8b05989 100644 --- a/rest_server/operations/service_policy/list_service_policies_parameters.go +++ b/rest_management_api_server/operations/service_policy/list_service_policies_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServicePoliciesParams creates a new ListServicePoliciesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServicePoliciesParams() ListServicePoliciesParams { return ListServicePoliciesParams{} @@ -94,7 +95,6 @@ func (o *ListServicePoliciesParams) BindRequest(r *http.Request, route *middlewa if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListServicePoliciesParams) bindFilter(rawData []string, hasKey bool, fo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListServicePoliciesParams) bindLimit(rawData []string, hasKey bool, for // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListServicePoliciesParams) bindOffset(rawData []string, hasKey bool, fo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service_policy/list_service_policies_responses.go b/rest_management_api_server/operations/service_policy/list_service_policies_responses.go similarity index 100% rename from rest_server/operations/service_policy/list_service_policies_responses.go rename to rest_management_api_server/operations/service_policy/list_service_policies_responses.go diff --git a/rest_server/operations/service_policy/list_service_policies_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/list_service_policies_urlbuilder.go rename to rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go index 95c218b94..38518f0b6 100644 --- a/rest_server/operations/service_policy/list_service_policies_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListServicePoliciesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/list_service_policy_identities.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities.go similarity index 93% rename from rest_server/operations/service_policy/list_service_policy_identities.go rename to rest_management_api_server/operations/service_policy/list_service_policy_identities.go index a01602355..214584c19 100644 --- a/rest_server/operations/service_policy/list_service_policy_identities.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_identities.go @@ -53,7 +53,7 @@ func NewListServicePolicyIdentities(ctx *middleware.Context, handler ListService return &ListServicePolicyIdentities{Context: ctx, Handler: handler} } -/*ListServicePolicyIdentities swagger:route GET /service-policies/{id}/identities Service Policy listServicePolicyIdentities +/* ListServicePolicyIdentities swagger:route GET /service-policies/{id}/identities Service Policy listServicePolicyIdentities List identities a service policy affects @@ -69,21 +69,20 @@ type ListServicePolicyIdentities struct { func (o *ListServicePolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServicePolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *http. } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/list_service_policy_identities_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go similarity index 98% rename from rest_server/operations/service_policy/list_service_policy_identities_parameters.go rename to rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go index 7e6b9aeae..22c532075 100644 --- a/rest_server/operations/service_policy/list_service_policy_identities_parameters.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServicePolicyIdentitiesParams creates a new ListServicePolicyIdentitiesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServicePolicyIdentitiesParams() ListServicePolicyIdentitiesParams { return ListServicePolicyIdentitiesParams{} @@ -104,7 +105,6 @@ func (o *ListServicePolicyIdentitiesParams) BindRequest(r *http.Request, route * if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServicePolicyIdentitiesParams) bindFilter(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServicePolicyIdentitiesParams) bindID(rawData []string, hasKey bool // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServicePolicyIdentitiesParams) bindLimit(rawData []string, hasKey b // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServicePolicyIdentitiesParams) bindOffset(rawData []string, hasKey // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service_policy/list_service_policy_identities_responses.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_responses.go similarity index 100% rename from rest_server/operations/service_policy/list_service_policy_identities_responses.go rename to rest_management_api_server/operations/service_policy/list_service_policy_identities_responses.go diff --git a/rest_server/operations/service_policy/list_service_policy_identities_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/list_service_policy_identities_urlbuilder.go rename to rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go index bb45b09cf..de953e05d 100644 --- a/rest_server/operations/service_policy/list_service_policy_identities_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServicePolicyIdentitiesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/list_service_policy_posture_checks.go b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go similarity index 93% rename from rest_server/operations/service_policy/list_service_policy_posture_checks.go rename to rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go index f9746e835..8870fa5f4 100644 --- a/rest_server/operations/service_policy/list_service_policy_posture_checks.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go @@ -53,7 +53,7 @@ func NewListServicePolicyPostureChecks(ctx *middleware.Context, handler ListServ return &ListServicePolicyPostureChecks{Context: ctx, Handler: handler} } -/*ListServicePolicyPostureChecks swagger:route GET /service-policies/{id}/posture-checks Service Policy listServicePolicyPostureChecks +/* ListServicePolicyPostureChecks swagger:route GET /service-policies/{id}/posture-checks Service Policy listServicePolicyPostureChecks List posture check a service policy includes @@ -69,21 +69,20 @@ type ListServicePolicyPostureChecks struct { func (o *ListServicePolicyPostureChecks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServicePolicyPostureChecks) ServeHTTP(rw http.ResponseWriter, r *ht } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_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 similarity index 98% rename from rest_server/operations/service_policy/list_service_policy_posture_checks_parameters.go rename to rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_parameters.go index 29f6b8b31..221ed5c74 100644 --- a/rest_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 @@ -40,7 +40,8 @@ import ( ) // NewListServicePolicyPostureChecksParams creates a new ListServicePolicyPostureChecksParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServicePolicyPostureChecksParams() ListServicePolicyPostureChecksParams { return ListServicePolicyPostureChecksParams{} @@ -104,7 +105,6 @@ func (o *ListServicePolicyPostureChecksParams) BindRequest(r *http.Request, rout if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServicePolicyPostureChecksParams) bindFilter(rawData []string, hasK // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServicePolicyPostureChecksParams) bindID(rawData []string, hasKey b // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServicePolicyPostureChecksParams) bindLimit(rawData []string, hasKe // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServicePolicyPostureChecksParams) bindOffset(rawData []string, hasK // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_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 similarity index 100% rename from rest_server/operations/service_policy/list_service_policy_posture_checks_responses.go rename to rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_responses.go diff --git a/rest_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 similarity index 99% rename from rest_server/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go rename to rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go index e2259481a..8cf085ee0 100644 --- a/rest_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 @@ -81,7 +81,7 @@ func (o *ListServicePolicyPostureChecksURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/list_service_policy_services.go b/rest_management_api_server/operations/service_policy/list_service_policy_services.go similarity index 93% rename from rest_server/operations/service_policy/list_service_policy_services.go rename to rest_management_api_server/operations/service_policy/list_service_policy_services.go index 25194c63f..3a0153048 100644 --- a/rest_server/operations/service_policy/list_service_policy_services.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_services.go @@ -53,7 +53,7 @@ func NewListServicePolicyServices(ctx *middleware.Context, handler ListServicePo return &ListServicePolicyServices{Context: ctx, Handler: handler} } -/*ListServicePolicyServices swagger:route GET /service-policies/{id}/services Service Policy listServicePolicyServices +/* ListServicePolicyServices swagger:route GET /service-policies/{id}/services Service Policy listServicePolicyServices List services a service policy affects @@ -69,21 +69,20 @@ type ListServicePolicyServices struct { func (o *ListServicePolicyServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListServicePolicyServices) ServeHTTP(rw http.ResponseWriter, r *http.Re } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/list_service_policy_services_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go similarity index 98% rename from rest_server/operations/service_policy/list_service_policy_services_parameters.go rename to rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go index 778b26667..d484c75f2 100644 --- a/rest_server/operations/service_policy/list_service_policy_services_parameters.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListServicePolicyServicesParams creates a new ListServicePolicyServicesParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListServicePolicyServicesParams() ListServicePolicyServicesParams { return ListServicePolicyServicesParams{} @@ -104,7 +105,6 @@ func (o *ListServicePolicyServicesParams) BindRequest(r *http.Request, route *mi if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -120,10 +120,10 @@ func (o *ListServicePolicyServicesParams) bindFilter(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -138,7 +138,6 @@ func (o *ListServicePolicyServicesParams) bindID(rawData []string, hasKey bool, // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil @@ -153,6 +152,7 @@ func (o *ListServicePolicyServicesParams) bindLimit(rawData []string, hasKey boo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -175,6 +175,7 @@ func (o *ListServicePolicyServicesParams) bindOffset(rawData []string, hasKey bo // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/service_policy/list_service_policy_services_responses.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_responses.go similarity index 100% rename from rest_server/operations/service_policy/list_service_policy_services_responses.go rename to rest_management_api_server/operations/service_policy/list_service_policy_services_responses.go diff --git a/rest_server/operations/service_policy/list_service_policy_services_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/list_service_policy_services_urlbuilder.go rename to rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go index f5988f108..646e17786 100644 --- a/rest_server/operations/service_policy/list_service_policy_services_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go @@ -81,7 +81,7 @@ func (o *ListServicePolicyServicesURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/patch_service_policy.go b/rest_management_api_server/operations/service_policy/patch_service_policy.go similarity index 93% rename from rest_server/operations/service_policy/patch_service_policy.go rename to rest_management_api_server/operations/service_policy/patch_service_policy.go index 96f205779..f0e5e070e 100644 --- a/rest_server/operations/service_policy/patch_service_policy.go +++ b/rest_management_api_server/operations/service_policy/patch_service_policy.go @@ -53,7 +53,7 @@ func NewPatchServicePolicy(ctx *middleware.Context, handler PatchServicePolicyHa return &PatchServicePolicy{Context: ctx, Handler: handler} } -/*PatchServicePolicy swagger:route PATCH /service-policies/{id} Service Policy patchServicePolicy +/* PatchServicePolicy swagger:route PATCH /service-policies/{id} Service Policy patchServicePolicy Update the supplied fields on a service policy @@ -68,21 +68,20 @@ type PatchServicePolicy struct { func (o *PatchServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/patch_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go similarity index 93% rename from rest_server/operations/service_policy/patch_service_policy_parameters.go rename to rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go index 338528d44..47374f7c7 100644 --- a/rest_server/operations/service_policy/patch_service_policy_parameters.go +++ b/rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go @@ -30,6 +30,7 @@ package service_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchServicePolicyParams() PatchServicePolicyParams { return PatchServicePolicyParams{} @@ -98,6 +101,11 @@ func (o *PatchServicePolicyParams) BindRequest(r *http.Request, route *middlewar 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 } @@ -120,7 +128,6 @@ func (o *PatchServicePolicyParams) bindID(rawData []string, hasKey bool, formats // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service_policy/patch_service_policy_responses.go b/rest_management_api_server/operations/service_policy/patch_service_policy_responses.go similarity index 100% rename from rest_server/operations/service_policy/patch_service_policy_responses.go rename to rest_management_api_server/operations/service_policy/patch_service_policy_responses.go diff --git a/rest_server/operations/service_policy/patch_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go similarity index 98% rename from rest_server/operations/service_policy/patch_service_policy_urlbuilder.go rename to rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go index 3914dc8a6..1e082e4e5 100644 --- a/rest_server/operations/service_policy/patch_service_policy_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchServicePolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/service_policy/update_service_policy.go b/rest_management_api_server/operations/service_policy/update_service_policy.go similarity index 93% rename from rest_server/operations/service_policy/update_service_policy.go rename to rest_management_api_server/operations/service_policy/update_service_policy.go index 1d179b563..175c07a68 100644 --- a/rest_server/operations/service_policy/update_service_policy.go +++ b/rest_management_api_server/operations/service_policy/update_service_policy.go @@ -53,7 +53,7 @@ func NewUpdateServicePolicy(ctx *middleware.Context, handler UpdateServicePolicy return &UpdateServicePolicy{Context: ctx, Handler: handler} } -/*UpdateServicePolicy swagger:route PUT /service-policies/{id} Service Policy updateServicePolicy +/* UpdateServicePolicy swagger:route PUT /service-policies/{id} Service Policy updateServicePolicy Update all fields on a service policy @@ -68,21 +68,20 @@ type UpdateServicePolicy struct { func (o *UpdateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/service_policy/update_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/update_service_policy_parameters.go similarity index 93% rename from rest_server/operations/service_policy/update_service_policy_parameters.go rename to rest_management_api_server/operations/service_policy/update_service_policy_parameters.go index e9b666729..0386d2796 100644 --- a/rest_server/operations/service_policy/update_service_policy_parameters.go +++ b/rest_management_api_server/operations/service_policy/update_service_policy_parameters.go @@ -30,6 +30,7 @@ package service_policy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateServicePolicyParams() UpdateServicePolicyParams { return UpdateServicePolicyParams{} @@ -98,6 +101,11 @@ func (o *UpdateServicePolicyParams) BindRequest(r *http.Request, route *middlewa 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 } @@ -120,7 +128,6 @@ func (o *UpdateServicePolicyParams) bindID(rawData []string, hasKey bool, format // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/service_policy/update_service_policy_responses.go b/rest_management_api_server/operations/service_policy/update_service_policy_responses.go similarity index 100% rename from rest_server/operations/service_policy/update_service_policy_responses.go rename to rest_management_api_server/operations/service_policy/update_service_policy_responses.go diff --git a/rest_server/operations/service_policy/update_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go similarity index 99% rename from rest_server/operations/service_policy/update_service_policy_urlbuilder.go rename to rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go index 5e79f041a..0ed101582 100644 --- a/rest_server/operations/service_policy/update_service_policy_urlbuilder.go +++ b/rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateServicePolicyURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/session/delete_session.go b/rest_management_api_server/operations/session/delete_session.go similarity index 94% rename from rest_server/operations/session/delete_session.go rename to rest_management_api_server/operations/session/delete_session.go index 5ffd008c6..d3aa4f247 100644 --- a/rest_server/operations/session/delete_session.go +++ b/rest_management_api_server/operations/session/delete_session.go @@ -53,7 +53,7 @@ func NewDeleteSession(ctx *middleware.Context, handler DeleteSessionHandler) *De return &DeleteSession{Context: ctx, Handler: handler} } -/*DeleteSession swagger:route DELETE /sessions/{id} Session deleteSession +/* DeleteSession swagger:route DELETE /sessions/{id} Session deleteSession Delete a session @@ -68,21 +68,20 @@ type DeleteSession struct { func (o *DeleteSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } 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 new file mode 100644 index 000000000..3df23a714 --- /dev/null +++ b/rest_management_api_server/operations/session/delete_session_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..2b4f44f5e --- /dev/null +++ b/rest_management_api_server/operations/session/delete_session_responses.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..fb3dece62 --- /dev/null +++ b/rest_management_api_server/operations/session/delete_session_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/detail_session.go b/rest_management_api_server/operations/session/detail_session.go similarity index 94% rename from rest_server/operations/session/detail_session.go rename to rest_management_api_server/operations/session/detail_session.go index bfcb5a6e2..a2787c972 100644 --- a/rest_server/operations/session/detail_session.go +++ b/rest_management_api_server/operations/session/detail_session.go @@ -53,7 +53,7 @@ func NewDetailSession(ctx *middleware.Context, handler DetailSessionHandler) *De return &DetailSession{Context: ctx, Handler: handler} } -/*DetailSession swagger:route GET /sessions/{id} Session detailSession +/* DetailSession swagger:route GET /sessions/{id} Session detailSession Retrieves a single session @@ -68,21 +68,20 @@ type DetailSession struct { func (o *DetailSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } 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 new file mode 100644 index 000000000..d0cdead74 --- /dev/null +++ b/rest_management_api_server/operations/session/detail_session_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..460742af2 --- /dev/null +++ b/rest_management_api_server/operations/session/detail_session_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/detail_session_route_path.go b/rest_management_api_server/operations/session/detail_session_route_path.go similarity index 93% rename from rest_server/operations/session/detail_session_route_path.go rename to rest_management_api_server/operations/session/detail_session_route_path.go index 32bc13d48..13a9c83c9 100644 --- a/rest_server/operations/session/detail_session_route_path.go +++ b/rest_management_api_server/operations/session/detail_session_route_path.go @@ -53,7 +53,7 @@ func NewDetailSessionRoutePath(ctx *middleware.Context, handler DetailSessionRou return &DetailSessionRoutePath{Context: ctx, Handler: handler} } -/*DetailSessionRoutePath swagger:route GET /sessions/{id}/route-path Session detailSessionRoutePath +/* DetailSessionRoutePath swagger:route GET /sessions/{id}/route-path Session detailSessionRoutePath Retrieves a single session's router path @@ -68,21 +68,20 @@ type DetailSessionRoutePath struct { func (o *DetailSessionRoutePath) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailSessionRoutePath) ServeHTTP(rw http.ResponseWriter, r *http.Reque } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/session/detail_session_route_path_parameters.go b/rest_management_api_server/operations/session/detail_session_route_path_parameters.go similarity index 98% rename from rest_server/operations/session/detail_session_route_path_parameters.go rename to rest_management_api_server/operations/session/detail_session_route_path_parameters.go index 5c9490b7f..b4f08c7c2 100644 --- a/rest_server/operations/session/detail_session_route_path_parameters.go +++ b/rest_management_api_server/operations/session/detail_session_route_path_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailSessionRoutePathParams creates a new DetailSessionRoutePathParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailSessionRoutePathParams() DetailSessionRoutePathParams { return DetailSessionRoutePathParams{} @@ -73,7 +74,6 @@ func (o *DetailSessionRoutePathParams) BindRequest(r *http.Request, route *middl if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailSessionRoutePathParams) bindID(rawData []string, hasKey bool, for // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/session/detail_session_route_path_responses.go b/rest_management_api_server/operations/session/detail_session_route_path_responses.go similarity index 100% rename from rest_server/operations/session/detail_session_route_path_responses.go rename to rest_management_api_server/operations/session/detail_session_route_path_responses.go diff --git a/rest_server/operations/session/detail_session_route_path_urlbuilder.go b/rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go similarity index 99% rename from rest_server/operations/session/detail_session_route_path_urlbuilder.go rename to rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go index 2aec1191b..2ac3a93d9 100644 --- a/rest_server/operations/session/detail_session_route_path_urlbuilder.go +++ b/rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailSessionRoutePathURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_management_api_server/operations/session/detail_session_urlbuilder.go b/rest_management_api_server/operations/session/detail_session_urlbuilder.go new file mode 100644 index 000000000..9c7be189c --- /dev/null +++ b/rest_management_api_server/operations/session/detail_session_urlbuilder.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/session/list_sessions.go b/rest_management_api_server/operations/session/list_sessions.go similarity index 94% rename from rest_server/operations/session/list_sessions.go rename to rest_management_api_server/operations/session/list_sessions.go index aa5fd9ddc..b1b2c004e 100644 --- a/rest_server/operations/session/list_sessions.go +++ b/rest_management_api_server/operations/session/list_sessions.go @@ -53,7 +53,7 @@ func NewListSessions(ctx *middleware.Context, handler ListSessionsHandler) *List return &ListSessions{Context: ctx, Handler: handler} } -/*ListSessions swagger:route GET /sessions Session listSessions +/* ListSessions swagger:route GET /sessions Session listSessions List sessions @@ -72,21 +72,20 @@ type ListSessions struct { func (o *ListSessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -95,7 +94,6 @@ func (o *ListSessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } 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 new file mode 100644 index 000000000..abfed115d --- /dev/null +++ b/rest_management_api_server/operations/session/list_sessions_parameters.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 new file mode 100644 index 000000000..ee34bd45d --- /dev/null +++ b/rest_management_api_server/operations/session/list_sessions_responses.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + } + } +} + +// 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 new file mode 100644 index 000000000..0f00c1ff9 --- /dev/null +++ b/rest_management_api_server/operations/session/list_sessions_urlbuilder.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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_server/operations/terminator/create_terminator.go b/rest_management_api_server/operations/terminator/create_terminator.go similarity index 94% rename from rest_server/operations/terminator/create_terminator.go rename to rest_management_api_server/operations/terminator/create_terminator.go index fffee1189..41523256d 100644 --- a/rest_server/operations/terminator/create_terminator.go +++ b/rest_management_api_server/operations/terminator/create_terminator.go @@ -53,7 +53,7 @@ func NewCreateTerminator(ctx *middleware.Context, handler CreateTerminatorHandle return &CreateTerminator{Context: ctx, Handler: handler} } -/*CreateTerminator swagger:route POST /terminators Terminator createTerminator +/* CreateTerminator swagger:route POST /terminators Terminator createTerminator Create a terminator resource @@ -68,21 +68,20 @@ type CreateTerminator struct { func (o *CreateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *CreateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/create_terminator_parameters.go b/rest_management_api_server/operations/terminator/create_terminator_parameters.go similarity index 92% rename from rest_server/operations/terminator/create_terminator_parameters.go rename to rest_management_api_server/operations/terminator/create_terminator_parameters.go index 73d3bf119..d4d1dc8fb 100644 --- a/rest_server/operations/terminator/create_terminator_parameters.go +++ b/rest_management_api_server/operations/terminator/create_terminator_parameters.go @@ -30,18 +30,21 @@ package terminator // 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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewCreateTerminatorParams() CreateTerminatorParams { return CreateTerminatorParams{} @@ -87,6 +90,11 @@ func (o *CreateTerminatorParams) BindRequest(r *http.Request, route *middleware. 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 } diff --git a/rest_server/operations/terminator/create_terminator_responses.go b/rest_management_api_server/operations/terminator/create_terminator_responses.go similarity index 100% rename from rest_server/operations/terminator/create_terminator_responses.go rename to rest_management_api_server/operations/terminator/create_terminator_responses.go diff --git a/rest_server/operations/terminator/create_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go similarity index 98% rename from rest_server/operations/terminator/create_terminator_urlbuilder.go rename to rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go index fdde6808a..9f9501592 100644 --- a/rest_server/operations/terminator/create_terminator_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go @@ -63,7 +63,7 @@ func (o *CreateTerminatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/terminator/delete_terminator.go b/rest_management_api_server/operations/terminator/delete_terminator.go similarity index 93% rename from rest_server/operations/terminator/delete_terminator.go rename to rest_management_api_server/operations/terminator/delete_terminator.go index 4b17dbb10..b1579c0af 100644 --- a/rest_server/operations/terminator/delete_terminator.go +++ b/rest_management_api_server/operations/terminator/delete_terminator.go @@ -53,7 +53,7 @@ func NewDeleteTerminator(ctx *middleware.Context, handler DeleteTerminatorHandle return &DeleteTerminator{Context: ctx, Handler: handler} } -/*DeleteTerminator swagger:route DELETE /terminators/{id} Terminator deleteTerminator +/* DeleteTerminator swagger:route DELETE /terminators/{id} Terminator deleteTerminator Delete a terminator @@ -68,21 +68,20 @@ type DeleteTerminator struct { func (o *DeleteTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DeleteTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/delete_terminator_parameters.go b/rest_management_api_server/operations/terminator/delete_terminator_parameters.go similarity index 98% rename from rest_server/operations/terminator/delete_terminator_parameters.go rename to rest_management_api_server/operations/terminator/delete_terminator_parameters.go index c933ca1eb..65ffbdcb0 100644 --- a/rest_server/operations/terminator/delete_terminator_parameters.go +++ b/rest_management_api_server/operations/terminator/delete_terminator_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDeleteTerminatorParams creates a new DeleteTerminatorParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDeleteTerminatorParams() DeleteTerminatorParams { return DeleteTerminatorParams{} @@ -73,7 +74,6 @@ func (o *DeleteTerminatorParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DeleteTerminatorParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/terminator/delete_terminator_responses.go b/rest_management_api_server/operations/terminator/delete_terminator_responses.go similarity index 100% rename from rest_server/operations/terminator/delete_terminator_responses.go rename to rest_management_api_server/operations/terminator/delete_terminator_responses.go diff --git a/rest_server/operations/terminator/delete_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go similarity index 98% rename from rest_server/operations/terminator/delete_terminator_urlbuilder.go rename to rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go index 038b4e99b..63e1c03e1 100644 --- a/rest_server/operations/terminator/delete_terminator_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DeleteTerminatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/terminator/detail_terminator.go b/rest_management_api_server/operations/terminator/detail_terminator.go similarity index 94% rename from rest_server/operations/terminator/detail_terminator.go rename to rest_management_api_server/operations/terminator/detail_terminator.go index 136d21bba..b411c185a 100644 --- a/rest_server/operations/terminator/detail_terminator.go +++ b/rest_management_api_server/operations/terminator/detail_terminator.go @@ -53,7 +53,7 @@ func NewDetailTerminator(ctx *middleware.Context, handler DetailTerminatorHandle return &DetailTerminator{Context: ctx, Handler: handler} } -/*DetailTerminator swagger:route GET /terminators/{id} Terminator detailTerminator +/* DetailTerminator swagger:route GET /terminators/{id} Terminator detailTerminator Retrieves a single terminator @@ -68,21 +68,20 @@ type DetailTerminator struct { func (o *DetailTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *DetailTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/detail_terminator_parameters.go b/rest_management_api_server/operations/terminator/detail_terminator_parameters.go similarity index 98% rename from rest_server/operations/terminator/detail_terminator_parameters.go rename to rest_management_api_server/operations/terminator/detail_terminator_parameters.go index 6be9f48ed..cff8a8de4 100644 --- a/rest_server/operations/terminator/detail_terminator_parameters.go +++ b/rest_management_api_server/operations/terminator/detail_terminator_parameters.go @@ -38,7 +38,8 @@ import ( ) // NewDetailTerminatorParams creates a new DetailTerminatorParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewDetailTerminatorParams() DetailTerminatorParams { return DetailTerminatorParams{} @@ -73,7 +74,6 @@ func (o *DetailTerminatorParams) BindRequest(r *http.Request, route *middleware. if err := o.bindID(rID, rhkID, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,7 +89,6 @@ func (o *DetailTerminatorParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/terminator/detail_terminator_responses.go b/rest_management_api_server/operations/terminator/detail_terminator_responses.go similarity index 100% rename from rest_server/operations/terminator/detail_terminator_responses.go rename to rest_management_api_server/operations/terminator/detail_terminator_responses.go diff --git a/rest_server/operations/terminator/detail_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go similarity index 98% rename from rest_server/operations/terminator/detail_terminator_urlbuilder.go rename to rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go index ef42913de..a50b7e64c 100644 --- a/rest_server/operations/terminator/detail_terminator_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *DetailTerminatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/terminator/list_terminators.go b/rest_management_api_server/operations/terminator/list_terminators.go similarity index 94% rename from rest_server/operations/terminator/list_terminators.go rename to rest_management_api_server/operations/terminator/list_terminators.go index a43eafa00..a5f962279 100644 --- a/rest_server/operations/terminator/list_terminators.go +++ b/rest_management_api_server/operations/terminator/list_terminators.go @@ -53,7 +53,7 @@ func NewListTerminators(ctx *middleware.Context, handler ListTerminatorsHandler) return &ListTerminators{Context: ctx, Handler: handler} } -/*ListTerminators swagger:route GET /terminators Terminator listTerminators +/* ListTerminators swagger:route GET /terminators Terminator listTerminators List terminators @@ -69,21 +69,20 @@ type ListTerminators struct { func (o *ListTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -92,7 +91,6 @@ func (o *ListTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/list_terminators_parameters.go b/rest_management_api_server/operations/terminator/list_terminators_parameters.go similarity index 98% rename from rest_server/operations/terminator/list_terminators_parameters.go rename to rest_management_api_server/operations/terminator/list_terminators_parameters.go index e7482e6dc..84fc1e620 100644 --- a/rest_server/operations/terminator/list_terminators_parameters.go +++ b/rest_management_api_server/operations/terminator/list_terminators_parameters.go @@ -40,7 +40,8 @@ import ( ) // NewListTerminatorsParams creates a new ListTerminatorsParams object -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewListTerminatorsParams() ListTerminatorsParams { return ListTerminatorsParams{} @@ -94,7 +95,6 @@ func (o *ListTerminatorsParams) BindRequest(r *http.Request, route *middleware.M if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { res = append(res, err) } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -110,10 +110,10 @@ func (o *ListTerminatorsParams) bindFilter(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } - o.Filter = &raw return nil @@ -128,6 +128,7 @@ func (o *ListTerminatorsParams) bindLimit(rawData []string, hasKey bool, formats // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } @@ -150,6 +151,7 @@ func (o *ListTerminatorsParams) bindOffset(rawData []string, hasKey bool, format // Required: false // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations return nil } diff --git a/rest_server/operations/terminator/list_terminators_responses.go b/rest_management_api_server/operations/terminator/list_terminators_responses.go similarity index 100% rename from rest_server/operations/terminator/list_terminators_responses.go rename to rest_management_api_server/operations/terminator/list_terminators_responses.go diff --git a/rest_server/operations/terminator/list_terminators_urlbuilder.go b/rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go similarity index 99% rename from rest_server/operations/terminator/list_terminators_urlbuilder.go rename to rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go index 2664dbc51..2110ff26f 100644 --- a/rest_server/operations/terminator/list_terminators_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go @@ -71,7 +71,7 @@ func (o *ListTerminatorsURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/terminator/patch_terminator.go b/rest_management_api_server/operations/terminator/patch_terminator.go similarity index 94% rename from rest_server/operations/terminator/patch_terminator.go rename to rest_management_api_server/operations/terminator/patch_terminator.go index dba6fbf5c..a5f4813c3 100644 --- a/rest_server/operations/terminator/patch_terminator.go +++ b/rest_management_api_server/operations/terminator/patch_terminator.go @@ -53,7 +53,7 @@ func NewPatchTerminator(ctx *middleware.Context, handler PatchTerminatorHandler) return &PatchTerminator{Context: ctx, Handler: handler} } -/*PatchTerminator swagger:route PATCH /terminators/{id} Terminator patchTerminator +/* PatchTerminator swagger:route PATCH /terminators/{id} Terminator patchTerminator Update the supplied fields on a terminator @@ -68,21 +68,20 @@ type PatchTerminator struct { func (o *PatchTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *PatchTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/patch_terminator_parameters.go b/rest_management_api_server/operations/terminator/patch_terminator_parameters.go similarity index 93% rename from rest_server/operations/terminator/patch_terminator_parameters.go rename to rest_management_api_server/operations/terminator/patch_terminator_parameters.go index 5d8ecd56a..cdb0ad538 100644 --- a/rest_server/operations/terminator/patch_terminator_parameters.go +++ b/rest_management_api_server/operations/terminator/patch_terminator_parameters.go @@ -30,6 +30,7 @@ package terminator // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewPatchTerminatorParams() PatchTerminatorParams { return PatchTerminatorParams{} @@ -98,6 +101,11 @@ func (o *PatchTerminatorParams) BindRequest(r *http.Request, route *middleware.M 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 } @@ -120,7 +128,6 @@ func (o *PatchTerminatorParams) bindID(rawData []string, hasKey bool, formats st // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/terminator/patch_terminator_responses.go b/rest_management_api_server/operations/terminator/patch_terminator_responses.go similarity index 100% rename from rest_server/operations/terminator/patch_terminator_responses.go rename to rest_management_api_server/operations/terminator/patch_terminator_responses.go diff --git a/rest_server/operations/terminator/patch_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go similarity index 98% rename from rest_server/operations/terminator/patch_terminator_urlbuilder.go rename to rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go index 99f6c6111..177fa9175 100644 --- a/rest_server/operations/terminator/patch_terminator_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *PatchTerminatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/terminator/update_terminator.go b/rest_management_api_server/operations/terminator/update_terminator.go similarity index 94% rename from rest_server/operations/terminator/update_terminator.go rename to rest_management_api_server/operations/terminator/update_terminator.go index 9668cf9ff..48c010e80 100644 --- a/rest_server/operations/terminator/update_terminator.go +++ b/rest_management_api_server/operations/terminator/update_terminator.go @@ -53,7 +53,7 @@ func NewUpdateTerminator(ctx *middleware.Context, handler UpdateTerminatorHandle return &UpdateTerminator{Context: ctx, Handler: handler} } -/*UpdateTerminator swagger:route PUT /terminators/{id} Terminator updateTerminator +/* UpdateTerminator swagger:route PUT /terminators/{id} Terminator updateTerminator Update all fields on a terminator @@ -68,21 +68,20 @@ type UpdateTerminator struct { func (o *UpdateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *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 + *r = *aCtx } var principal interface{} if uprinc != nil { - principal = uprinc + principal = uprinc.(interface{}) // this is really a interface{}, I promise } if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params @@ -91,7 +90,6 @@ func (o *UpdateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) } diff --git a/rest_server/operations/terminator/update_terminator_parameters.go b/rest_management_api_server/operations/terminator/update_terminator_parameters.go similarity index 93% rename from rest_server/operations/terminator/update_terminator_parameters.go rename to rest_management_api_server/operations/terminator/update_terminator_parameters.go index 176bbd89e..b623395af 100644 --- a/rest_server/operations/terminator/update_terminator_parameters.go +++ b/rest_management_api_server/operations/terminator/update_terminator_parameters.go @@ -30,6 +30,7 @@ package terminator // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "io" "net/http" @@ -37,12 +38,14 @@ import ( "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 -// no default values defined in spec. +// +// There are no default values defined in the spec. func NewUpdateTerminatorParams() UpdateTerminatorParams { return UpdateTerminatorParams{} @@ -98,6 +101,11 @@ func (o *UpdateTerminatorParams) BindRequest(r *http.Request, route *middleware. 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 } @@ -120,7 +128,6 @@ func (o *UpdateTerminatorParams) bindID(rawData []string, hasKey bool, formats s // Required: true // Parameter is provided by construction from the route - o.ID = raw return nil diff --git a/rest_server/operations/terminator/update_terminator_responses.go b/rest_management_api_server/operations/terminator/update_terminator_responses.go similarity index 100% rename from rest_server/operations/terminator/update_terminator_responses.go rename to rest_management_api_server/operations/terminator/update_terminator_responses.go diff --git a/rest_server/operations/terminator/update_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go similarity index 98% rename from rest_server/operations/terminator/update_terminator_urlbuilder.go rename to rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go index 59f398e54..8ab948d58 100644 --- a/rest_server/operations/terminator/update_terminator_urlbuilder.go +++ b/rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go @@ -75,7 +75,7 @@ func (o *UpdateTerminatorURL) Build() (*url.URL, error) { _basePath := o._basePath if _basePath == "" { - _basePath = "/edge/v1" + _basePath = "/edge/management/v1" } _result.Path = golangswaggerpaths.Join(_basePath, _path) diff --git a/rest_server/operations/ziti_edge_api.go b/rest_management_api_server/operations/ziti_edge_management_api.go similarity index 83% rename from rest_server/operations/ziti_edge_api.go rename to rest_management_api_server/operations/ziti_edge_management_api.go index c37a9f8f1..da98c3618 100644 --- a/rest_server/operations/ziti_edge_api.go +++ b/rest_management_api_server/operations/ziti_edge_management_api.go @@ -44,35 +44,32 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/openziti/edge/rest_server/operations/api_session" - "github.com/openziti/edge/rest_server/operations/authentication" - "github.com/openziti/edge/rest_server/operations/authenticator" - "github.com/openziti/edge/rest_server/operations/certificate_authority" - "github.com/openziti/edge/rest_server/operations/config" - "github.com/openziti/edge/rest_server/operations/current_api_session" - "github.com/openziti/edge/rest_server/operations/current_identity" - "github.com/openziti/edge/rest_server/operations/database" - "github.com/openziti/edge/rest_server/operations/edge_router" - "github.com/openziti/edge/rest_server/operations/edge_router_policy" - "github.com/openziti/edge/rest_server/operations/enroll" - "github.com/openziti/edge/rest_server/operations/enrollment" - "github.com/openziti/edge/rest_server/operations/geo_region" - "github.com/openziti/edge/rest_server/operations/identity" - "github.com/openziti/edge/rest_server/operations/informational" - "github.com/openziti/edge/rest_server/operations/posture_checks" - "github.com/openziti/edge/rest_server/operations/role_attributes" - "github.com/openziti/edge/rest_server/operations/service" - "github.com/openziti/edge/rest_server/operations/service_edge_router_policy" - "github.com/openziti/edge/rest_server/operations/service_policy" - "github.com/openziti/edge/rest_server/operations/session" - "github.com/openziti/edge/rest_server/operations/terminator" - "github.com/openziti/edge/rest_server/operations/transit_router" - "github.com/openziti/edge/rest_server/operations/well_known" + "github.com/openziti/edge/rest_management_api_server/operations/api_session" + "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/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" ) -// NewZitiEdgeAPI creates a new ZitiEdge instance -func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { - return &ZitiEdgeAPI{ +// 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", @@ -88,27 +85,12 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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(), ApplicationJwtProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { return errors.NotImplemented("applicationJwt producer has not yet been implemented") }), - 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 { @@ -142,9 +124,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { ConfigCreateConfigTypeHandler: config.CreateConfigTypeHandlerFunc(func(params config.CreateConfigTypeParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.CreateConfigType 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") - }), DatabaseCreateDatabaseSnapshotHandler: database.CreateDatabaseSnapshotHandlerFunc(func(params database.CreateDatabaseSnapshotParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation database.CreateDatabaseSnapshot has not yet been implemented") }), @@ -163,11 +142,8 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), - 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") + 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") @@ -178,14 +154,11 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), - SessionCreateSessionHandler: session.CreateSessionHandlerFunc(func(params session.CreateSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.CreateSession 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") }), - TransitRouterCreateTransitRouterHandler: transit_router.CreateTransitRouterHandlerFunc(func(params transit_router.CreateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.CreateTransitRouter 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") @@ -205,9 +178,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { ConfigDeleteConfigTypeHandler: config.DeleteConfigTypeHandlerFunc(func(params config.DeleteConfigTypeParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.DeleteConfigType 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") - }), 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") }), @@ -226,6 +196,9 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), @@ -241,8 +214,8 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { TerminatorDeleteTerminatorHandler: terminator.DeleteTerminatorHandlerFunc(func(params terminator.DeleteTerminatorParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation terminator.DeleteTerminator has not yet been implemented") }), - TransitRouterDeleteTransitRouterHandler: transit_router.DeleteTransitRouterHandlerFunc(func(params transit_router.DeleteTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.DeleteTransitRouter 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") @@ -259,9 +232,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { ConfigDetailConfigTypeHandler: config.DetailConfigTypeHandlerFunc(func(params config.DetailConfigTypeParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.DetailConfigType 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") }), @@ -274,9 +244,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { EnrollmentDetailEnrollmentHandler: enrollment.DetailEnrollmentHandlerFunc(func(params enrollment.DetailEnrollmentParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation enrollment.DetailEnrollment has not yet been implemented") }), - GeoRegionDetailGeoRegionHandler: geo_region.DetailGeoRegionHandlerFunc(func(params geo_region.DetailGeoRegionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation geo_region.DetailGeoRegion 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") }), @@ -298,6 +265,9 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), @@ -322,36 +292,15 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { TerminatorDetailTerminatorHandler: terminator.DetailTerminatorHandlerFunc(func(params terminator.DetailTerminatorParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation terminator.DetailTerminator has not yet been implemented") }), - TransitRouterDetailTransitRouterHandler: transit_router.DetailTransitRouterHandlerFunc(func(params transit_router.DetailTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.DetailTransitRouter 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") }), IdentityDisassociateIdentitysServiceConfigsHandler: identity.DisassociateIdentitysServiceConfigsHandlerFunc(func(params identity.DisassociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation identity.DisassociateIdentitysServiceConfigs 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") - }), - EnrollExtendRouterEnrollmentHandler: enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.ExtendRouterEnrollment 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") }), @@ -364,9 +313,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") - }), IdentityGetIdentityFailedServiceRequestsHandler: identity.GetIdentityFailedServiceRequestsHandlerFunc(func(params identity.GetIdentityFailedServiceRequestsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation identity.GetIdentityFailedServiceRequests has not yet been implemented") }), @@ -394,9 +340,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { ConfigListConfigsForConfigTypeHandler: config.ListConfigsForConfigTypeHandlerFunc(func(params config.ListConfigsForConfigTypeParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation config.ListConfigsForConfigType 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") }), @@ -430,9 +373,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { EnrollmentListEnrollmentsHandler: enrollment.ListEnrollmentsHandlerFunc(func(params enrollment.ListEnrollmentsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation enrollment.ListEnrollments has not yet been implemented") }), - GeoRegionListGeoRegionsHandler: geo_region.ListGeoRegionsHandlerFunc(func(params geo_region.ListGeoRegionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation geo_region.ListGeoRegions 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") }), @@ -463,12 +403,12 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), - 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") }), + 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") }), @@ -511,9 +451,6 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), @@ -529,15 +466,12 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { TerminatorListTerminatorsHandler: terminator.ListTerminatorsHandlerFunc(func(params terminator.ListTerminatorsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation terminator.ListTerminators has not yet been implemented") }), - TransitRouterListTransitRoutersHandler: transit_router.ListTransitRoutersHandlerFunc(func(params transit_router.ListTransitRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.ListTransitRouters 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") }), - WellKnownListWellKnownCasHandler: well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder { - return middleware.NotImplemented("operation well_known.ListWellKnownCas 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") }), @@ -565,6 +499,9 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), @@ -577,8 +514,8 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { TerminatorPatchTerminatorHandler: terminator.PatchTerminatorHandlerFunc(func(params terminator.PatchTerminatorParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation terminator.PatchTerminator has not yet been implemented") }), - TransitRouterPatchTransitRouterHandler: transit_router.PatchTransitRouterHandlerFunc(func(params transit_router.PatchTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.PatchTransitRouter 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") }), IdentityRemoveIdentityMfaHandler: identity.RemoveIdentityMfaHandlerFunc(func(params identity.RemoveIdentityMfaParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation identity.RemoveIdentityMfa has not yet been implemented") @@ -610,6 +547,9 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { 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") }), @@ -622,8 +562,8 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { TerminatorUpdateTerminatorHandler: terminator.UpdateTerminatorHandlerFunc(func(params terminator.UpdateTerminatorParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation terminator.UpdateTerminator has not yet been implemented") }), - TransitRouterUpdateTransitRouterHandler: transit_router.UpdateTransitRouterHandlerFunc(func(params transit_router.UpdateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation transit_router.UpdateTransitRouter 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") @@ -641,8 +581,8 @@ func NewZitiEdgeAPI(spec *loads.Document) *ZitiEdgeAPI { } } -/*ZitiEdgeAPI the ziti edge API */ -type ZitiEdgeAPI struct { +/*ZitiEdgeManagementAPI the ziti edge management API */ +type ZitiEdgeManagementAPI struct { spec *loads.Document context *middleware.Context handlers map[string]map[string]http.Handler @@ -657,19 +597,15 @@ type ZitiEdgeAPI struct { // 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 @@ -680,15 +616,6 @@ type ZitiEdgeAPI struct { // ApplicationJwtProducer registers a producer for the following mime types: // - application/jwt ApplicationJwtProducer runtime.Producer - // 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 @@ -724,8 +651,6 @@ type ZitiEdgeAPI struct { ConfigCreateConfigHandler config.CreateConfigHandler // ConfigCreateConfigTypeHandler sets the operation handler for the create config type operation ConfigCreateConfigTypeHandler config.CreateConfigTypeHandler - // CurrentAPISessionCreateCurrentAPISessionCertificateHandler sets the operation handler for the create current Api session certificate operation - CurrentAPISessionCreateCurrentAPISessionCertificateHandler current_api_session.CreateCurrentAPISessionCertificateHandler // 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 @@ -738,22 +663,18 @@ type ZitiEdgeAPI struct { CurrentIdentityCreateMfaRecoveryCodesHandler current_identity.CreateMfaRecoveryCodesHandler // PostureChecksCreatePostureCheckHandler sets the operation handler for the create posture check operation PostureChecksCreatePostureCheckHandler posture_checks.CreatePostureCheckHandler - // 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 + // 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 - // SessionCreateSessionHandler sets the operation handler for the create session operation - SessionCreateSessionHandler session.CreateSessionHandler // TerminatorCreateTerminatorHandler sets the operation handler for the create terminator operation TerminatorCreateTerminatorHandler terminator.CreateTerminatorHandler - // TransitRouterCreateTransitRouterHandler sets the operation handler for the create transit router operation - TransitRouterCreateTransitRouterHandler transit_router.CreateTransitRouterHandler + // 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 @@ -766,8 +687,6 @@ type ZitiEdgeAPI struct { ConfigDeleteConfigHandler config.DeleteConfigHandler // ConfigDeleteConfigTypeHandler sets the operation handler for the delete config type operation ConfigDeleteConfigTypeHandler config.DeleteConfigTypeHandler - // CurrentAPISessionDeleteCurrentAPISessionCertificateHandler sets the operation handler for the delete current Api session certificate operation - CurrentAPISessionDeleteCurrentAPISessionCertificateHandler current_api_session.DeleteCurrentAPISessionCertificateHandler // 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 @@ -780,6 +699,8 @@ type ZitiEdgeAPI struct { 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 @@ -790,8 +711,8 @@ type ZitiEdgeAPI struct { SessionDeleteSessionHandler session.DeleteSessionHandler // TerminatorDeleteTerminatorHandler sets the operation handler for the delete terminator operation TerminatorDeleteTerminatorHandler terminator.DeleteTerminatorHandler - // TransitRouterDeleteTransitRouterHandler sets the operation handler for the delete transit router operation - TransitRouterDeleteTransitRouterHandler transit_router.DeleteTransitRouterHandler + // 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 // AuthenticatorDetailAuthenticatorHandler sets the operation handler for the detail authenticator operation @@ -802,8 +723,6 @@ type ZitiEdgeAPI struct { ConfigDetailConfigHandler config.DetailConfigHandler // ConfigDetailConfigTypeHandler sets the operation handler for the detail config type operation ConfigDetailConfigTypeHandler config.DetailConfigTypeHandler - // 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 // EdgeRouterDetailEdgeRouterHandler sets the operation handler for the detail edge router operation @@ -812,8 +731,6 @@ type ZitiEdgeAPI struct { EdgeRouterPolicyDetailEdgeRouterPolicyHandler edge_router_policy.DetailEdgeRouterPolicyHandler // EnrollmentDetailEnrollmentHandler sets the operation handler for the detail enrollment operation EnrollmentDetailEnrollmentHandler enrollment.DetailEnrollmentHandler - // GeoRegionDetailGeoRegionHandler sets the operation handler for the detail geo region operation - GeoRegionDetailGeoRegionHandler geo_region.DetailGeoRegionHandler // IdentityDetailIdentityHandler sets the operation handler for the detail identity operation IdentityDetailIdentityHandler identity.DetailIdentityHandler // IdentityDetailIdentityTypeHandler sets the operation handler for the detail identity type operation @@ -828,6 +745,8 @@ type ZitiEdgeAPI struct { 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 @@ -844,26 +763,12 @@ type ZitiEdgeAPI struct { InformationalDetailSpecBodyHandler informational.DetailSpecBodyHandler // TerminatorDetailTerminatorHandler sets the operation handler for the detail terminator operation TerminatorDetailTerminatorHandler terminator.DetailTerminatorHandler - // TransitRouterDetailTransitRouterHandler sets the operation handler for the detail transit router operation - TransitRouterDetailTransitRouterHandler transit_router.DetailTransitRouterHandler + // RouterDetailTransitRouterHandler sets the operation handler for the detail transit router operation + RouterDetailTransitRouterHandler router.DetailTransitRouterHandler // IdentityDisassociateIdentitysServiceConfigsHandler sets the operation handler for the disassociate identitys service configs operation IdentityDisassociateIdentitysServiceConfigsHandler identity.DisassociateIdentitysServiceConfigsHandler - // 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 - // EnrollExtendRouterEnrollmentHandler sets the operation handler for the extend router enrollment operation - EnrollExtendRouterEnrollmentHandler enroll.ExtendRouterEnrollmentHandler // 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 @@ -872,8 +777,6 @@ type ZitiEdgeAPI struct { 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 // 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 @@ -892,8 +795,6 @@ type ZitiEdgeAPI struct { ConfigListConfigsHandler config.ListConfigsHandler // ConfigListConfigsForConfigTypeHandler sets the operation handler for the list configs for config type operation ConfigListConfigsForConfigTypeHandler config.ListConfigsForConfigTypeHandler - // 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 // EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler sets the operation handler for the list edge router edge router policies operation @@ -916,8 +817,6 @@ type ZitiEdgeAPI struct { EdgeRouterListEdgeRoutersHandler edge_router.ListEdgeRoutersHandler // EnrollmentListEnrollmentsHandler sets the operation handler for the list enrollments operation EnrollmentListEnrollmentsHandler enrollment.ListEnrollmentsHandler - // GeoRegionListGeoRegionsHandler sets the operation handler for the list geo regions operation - GeoRegionListGeoRegionsHandler geo_region.ListGeoRegionsHandler // 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 @@ -938,10 +837,10 @@ type ZitiEdgeAPI struct { PostureChecksListPostureCheckTypesHandler posture_checks.ListPostureCheckTypesHandler // PostureChecksListPostureChecksHandler sets the operation handler for the list posture checks operation PostureChecksListPostureChecksHandler posture_checks.ListPostureChecksHandler - // 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 + // 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 @@ -970,8 +869,6 @@ type ZitiEdgeAPI struct { ServiceListServiceServicePoliciesHandler service.ListServiceServicePoliciesHandler // 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 @@ -982,12 +879,10 @@ type ZitiEdgeAPI struct { InformationalListSummaryHandler informational.ListSummaryHandler // TerminatorListTerminatorsHandler sets the operation handler for the list terminators operation TerminatorListTerminatorsHandler terminator.ListTerminatorsHandler - // TransitRouterListTransitRoutersHandler sets the operation handler for the list transit routers operation - TransitRouterListTransitRoutersHandler transit_router.ListTransitRoutersHandler + // 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 - // WellKnownListWellKnownCasHandler sets the operation handler for the list well known cas operation - WellKnownListWellKnownCasHandler well_known.ListWellKnownCasHandler // AuthenticatorPatchAuthenticatorHandler sets the operation handler for the patch authenticator operation AuthenticatorPatchAuthenticatorHandler authenticator.PatchAuthenticatorHandler // CertificateAuthorityPatchCaHandler sets the operation handler for the patch ca operation @@ -1006,6 +901,8 @@ type ZitiEdgeAPI struct { 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 @@ -1014,8 +911,8 @@ type ZitiEdgeAPI struct { ServicePolicyPatchServicePolicyHandler service_policy.PatchServicePolicyHandler // TerminatorPatchTerminatorHandler sets the operation handler for the patch terminator operation TerminatorPatchTerminatorHandler terminator.PatchTerminatorHandler - // TransitRouterPatchTransitRouterHandler sets the operation handler for the patch transit router operation - TransitRouterPatchTransitRouterHandler transit_router.PatchTransitRouterHandler + // RouterPatchTransitRouterHandler sets the operation handler for the patch transit router operation + RouterPatchTransitRouterHandler router.PatchTransitRouterHandler // IdentityRemoveIdentityMfaHandler sets the operation handler for the remove identity mfa operation IdentityRemoveIdentityMfaHandler identity.RemoveIdentityMfaHandler // AuthenticatorUpdateAuthenticatorHandler sets the operation handler for the update authenticator operation @@ -1036,6 +933,8 @@ type ZitiEdgeAPI struct { IdentityUpdateIdentityHandler identity.UpdateIdentityHandler // 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 @@ -1044,12 +943,13 @@ type ZitiEdgeAPI struct { ServicePolicyUpdateServicePolicyHandler service_policy.UpdateServicePolicyHandler // TerminatorUpdateTerminatorHandler sets the operation handler for the update terminator operation TerminatorUpdateTerminatorHandler terminator.UpdateTerminatorHandler - // TransitRouterUpdateTransitRouterHandler sets the operation handler for the update transit router operation - TransitRouterUpdateTransitRouterHandler transit_router.UpdateTransitRouterHandler + // 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) @@ -1070,60 +970,54 @@ type ZitiEdgeAPI struct { } // UseRedoc for documentation at /docs -func (o *ZitiEdgeAPI) UseRedoc() { +func (o *ZitiEdgeManagementAPI) UseRedoc() { o.useSwaggerUI = false } // UseSwaggerUI for documentation at /docs -func (o *ZitiEdgeAPI) UseSwaggerUI() { +func (o *ZitiEdgeManagementAPI) UseSwaggerUI() { o.useSwaggerUI = true } // SetDefaultProduces sets the default produces media type -func (o *ZitiEdgeAPI) SetDefaultProduces(mediaType string) { +func (o *ZitiEdgeManagementAPI) SetDefaultProduces(mediaType string) { o.defaultProduces = mediaType } // SetDefaultConsumes returns the default consumes media type -func (o *ZitiEdgeAPI) SetDefaultConsumes(mediaType string) { +func (o *ZitiEdgeManagementAPI) SetDefaultConsumes(mediaType string) { o.defaultConsumes = mediaType } // SetSpec sets a spec that will be served for the clients. -func (o *ZitiEdgeAPI) SetSpec(spec *loads.Document) { +func (o *ZitiEdgeManagementAPI) SetSpec(spec *loads.Document) { o.spec = spec } // DefaultProduces returns the default produces media type -func (o *ZitiEdgeAPI) DefaultProduces() string { +func (o *ZitiEdgeManagementAPI) DefaultProduces() string { return o.defaultProduces } // DefaultConsumes returns the default consumes media type -func (o *ZitiEdgeAPI) DefaultConsumes() string { +func (o *ZitiEdgeManagementAPI) DefaultConsumes() string { return o.defaultConsumes } // Formats returns the registered string formats -func (o *ZitiEdgeAPI) Formats() strfmt.Registry { +func (o *ZitiEdgeManagementAPI) Formats() strfmt.Registry { return o.formats } // RegisterFormat registers a custom format validator -func (o *ZitiEdgeAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.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 ZitiEdgeAPI -func (o *ZitiEdgeAPI) Validate() error { +// Validate validates the registrations in the ZitiEdgeManagementAPI +func (o *ZitiEdgeManagementAPI) 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") } @@ -1134,15 +1028,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ApplicationJwtProducer == nil { unregistered = append(unregistered, "ApplicationJwtProducer") } - 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") } @@ -1184,9 +1069,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ConfigCreateConfigTypeHandler == nil { unregistered = append(unregistered, "config.CreateConfigTypeHandler") } - if o.CurrentAPISessionCreateCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.CreateCurrentAPISessionCertificateHandler") - } if o.DatabaseCreateDatabaseSnapshotHandler == nil { unregistered = append(unregistered, "database.CreateDatabaseSnapshotHandler") } @@ -1205,11 +1087,8 @@ func (o *ZitiEdgeAPI) Validate() error { if o.PostureChecksCreatePostureCheckHandler == nil { unregistered = append(unregistered, "posture_checks.CreatePostureCheckHandler") } - if o.PostureChecksCreatePostureResponseHandler == nil { - unregistered = append(unregistered, "posture_checks.CreatePostureResponseHandler") - } - if o.PostureChecksCreatePostureResponseBulkHandler == nil { - unregistered = append(unregistered, "posture_checks.CreatePostureResponseBulkHandler") + if o.RouterCreateRouterHandler == nil { + unregistered = append(unregistered, "router.CreateRouterHandler") } if o.ServiceCreateServiceHandler == nil { unregistered = append(unregistered, "service.CreateServiceHandler") @@ -1220,14 +1099,11 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ServicePolicyCreateServicePolicyHandler == nil { unregistered = append(unregistered, "service_policy.CreateServicePolicyHandler") } - if o.SessionCreateSessionHandler == nil { - unregistered = append(unregistered, "session.CreateSessionHandler") - } if o.TerminatorCreateTerminatorHandler == nil { unregistered = append(unregistered, "terminator.CreateTerminatorHandler") } - if o.TransitRouterCreateTransitRouterHandler == nil { - unregistered = append(unregistered, "transit_router.CreateTransitRouterHandler") + if o.RouterCreateTransitRouterHandler == nil { + unregistered = append(unregistered, "router.CreateTransitRouterHandler") } if o.DatabaseDataIntegrityResultsHandler == nil { unregistered = append(unregistered, "database.DataIntegrityResultsHandler") @@ -1247,9 +1123,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ConfigDeleteConfigTypeHandler == nil { unregistered = append(unregistered, "config.DeleteConfigTypeHandler") } - if o.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionCertificateHandler") - } if o.EdgeRouterDeleteEdgeRouterHandler == nil { unregistered = append(unregistered, "edge_router.DeleteEdgeRouterHandler") } @@ -1268,6 +1141,9 @@ func (o *ZitiEdgeAPI) Validate() error { 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") } @@ -1283,8 +1159,8 @@ func (o *ZitiEdgeAPI) Validate() error { if o.TerminatorDeleteTerminatorHandler == nil { unregistered = append(unregistered, "terminator.DeleteTerminatorHandler") } - if o.TransitRouterDeleteTransitRouterHandler == nil { - unregistered = append(unregistered, "transit_router.DeleteTransitRouterHandler") + if o.RouterDeleteTransitRouterHandler == nil { + unregistered = append(unregistered, "router.DeleteTransitRouterHandler") } if o.APISessionDetailAPISessionsHandler == nil { unregistered = append(unregistered, "api_session.DetailAPISessionsHandler") @@ -1301,9 +1177,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ConfigDetailConfigTypeHandler == nil { unregistered = append(unregistered, "config.DetailConfigTypeHandler") } - if o.CurrentAPISessionDetailCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.DetailCurrentAPISessionCertificateHandler") - } if o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil { unregistered = append(unregistered, "current_api_session.DetailCurrentIdentityAuthenticatorHandler") } @@ -1316,9 +1189,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.EnrollmentDetailEnrollmentHandler == nil { unregistered = append(unregistered, "enrollment.DetailEnrollmentHandler") } - if o.GeoRegionDetailGeoRegionHandler == nil { - unregistered = append(unregistered, "geo_region.DetailGeoRegionHandler") - } if o.IdentityDetailIdentityHandler == nil { unregistered = append(unregistered, "identity.DetailIdentityHandler") } @@ -1340,6 +1210,9 @@ func (o *ZitiEdgeAPI) Validate() error { 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") } @@ -1364,36 +1237,15 @@ func (o *ZitiEdgeAPI) Validate() error { if o.TerminatorDetailTerminatorHandler == nil { unregistered = append(unregistered, "terminator.DetailTerminatorHandler") } - if o.TransitRouterDetailTransitRouterHandler == nil { - unregistered = append(unregistered, "transit_router.DetailTransitRouterHandler") + if o.RouterDetailTransitRouterHandler == nil { + unregistered = append(unregistered, "router.DetailTransitRouterHandler") } if o.IdentityDisassociateIdentitysServiceConfigsHandler == nil { unregistered = append(unregistered, "identity.DisassociateIdentitysServiceConfigsHandler") } - 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.EnrollExtendRouterEnrollmentHandler == nil { - unregistered = append(unregistered, "enroll.ExtendRouterEnrollmentHandler") - } if o.DatabaseFixDataIntegrityHandler == nil { unregistered = append(unregistered, "database.FixDataIntegrityHandler") } @@ -1406,9 +1258,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.CurrentIdentityGetCurrentIdentityHandler == nil { unregistered = append(unregistered, "current_identity.GetCurrentIdentityHandler") } - if o.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler == nil { - unregistered = append(unregistered, "current_identity.GetCurrentIdentityEdgeRoutersHandler") - } if o.IdentityGetIdentityFailedServiceRequestsHandler == nil { unregistered = append(unregistered, "identity.GetIdentityFailedServiceRequestsHandler") } @@ -1436,9 +1285,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.ConfigListConfigsForConfigTypeHandler == nil { unregistered = append(unregistered, "config.ListConfigsForConfigTypeHandler") } - if o.CurrentAPISessionListCurrentAPISessionCertificatesHandler == nil { - unregistered = append(unregistered, "current_api_session.ListCurrentAPISessionCertificatesHandler") - } if o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil { unregistered = append(unregistered, "current_api_session.ListCurrentIdentityAuthenticatorsHandler") } @@ -1472,9 +1318,6 @@ func (o *ZitiEdgeAPI) Validate() error { if o.EnrollmentListEnrollmentsHandler == nil { unregistered = append(unregistered, "enrollment.ListEnrollmentsHandler") } - if o.GeoRegionListGeoRegionsHandler == nil { - unregistered = append(unregistered, "geo_region.ListGeoRegionsHandler") - } if o.IdentityListIdentitiesHandler == nil { unregistered = append(unregistered, "identity.ListIdentitiesHandler") } @@ -1505,12 +1348,12 @@ func (o *ZitiEdgeAPI) Validate() error { if o.PostureChecksListPostureChecksHandler == nil { unregistered = append(unregistered, "posture_checks.ListPostureChecksHandler") } - if o.InformationalListProtocolsHandler == nil { - unregistered = append(unregistered, "informational.ListProtocolsHandler") - } 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") } @@ -1553,9 +1396,6 @@ func (o *ZitiEdgeAPI) Validate() error { 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") } @@ -1571,15 +1411,12 @@ func (o *ZitiEdgeAPI) Validate() error { if o.TerminatorListTerminatorsHandler == nil { unregistered = append(unregistered, "terminator.ListTerminatorsHandler") } - if o.TransitRouterListTransitRoutersHandler == nil { - unregistered = append(unregistered, "transit_router.ListTransitRoutersHandler") + if o.RouterListTransitRoutersHandler == nil { + unregistered = append(unregistered, "router.ListTransitRoutersHandler") } if o.InformationalListVersionHandler == nil { unregistered = append(unregistered, "informational.ListVersionHandler") } - if o.WellKnownListWellKnownCasHandler == nil { - unregistered = append(unregistered, "well_known.ListWellKnownCasHandler") - } if o.AuthenticatorPatchAuthenticatorHandler == nil { unregistered = append(unregistered, "authenticator.PatchAuthenticatorHandler") } @@ -1607,6 +1444,9 @@ func (o *ZitiEdgeAPI) Validate() error { 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") } @@ -1619,8 +1459,8 @@ func (o *ZitiEdgeAPI) Validate() error { if o.TerminatorPatchTerminatorHandler == nil { unregistered = append(unregistered, "terminator.PatchTerminatorHandler") } - if o.TransitRouterPatchTransitRouterHandler == nil { - unregistered = append(unregistered, "transit_router.PatchTransitRouterHandler") + if o.RouterPatchTransitRouterHandler == nil { + unregistered = append(unregistered, "router.PatchTransitRouterHandler") } if o.IdentityRemoveIdentityMfaHandler == nil { unregistered = append(unregistered, "identity.RemoveIdentityMfaHandler") @@ -1652,6 +1492,9 @@ func (o *ZitiEdgeAPI) Validate() error { 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") } @@ -1664,8 +1507,8 @@ func (o *ZitiEdgeAPI) Validate() error { if o.TerminatorUpdateTerminatorHandler == nil { unregistered = append(unregistered, "terminator.UpdateTerminatorHandler") } - if o.TransitRouterUpdateTransitRouterHandler == nil { - unregistered = append(unregistered, "transit_router.UpdateTransitRouterHandler") + if o.RouterUpdateTransitRouterHandler == nil { + unregistered = append(unregistered, "router.UpdateTransitRouterHandler") } if o.CertificateAuthorityVerifyCaHandler == nil { unregistered = append(unregistered, "certificate_authority.VerifyCaHandler") @@ -1682,12 +1525,12 @@ func (o *ZitiEdgeAPI) Validate() error { } // ServeErrorFor gets a error handler for a given operation id -func (o *ZitiEdgeAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { +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 *ZitiEdgeAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { +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 { @@ -1701,20 +1544,16 @@ func (o *ZitiEdgeAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) } // Authorizer returns the registered authorizer -func (o *ZitiEdgeAPI) Authorizer() runtime.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 *ZitiEdgeAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { +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/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": @@ -1730,18 +1569,12 @@ func (o *ZitiEdgeAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consu // ProducersFor gets the producers for the specified media types. // MIME type parameters are ignored here. -func (o *ZitiEdgeAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { +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 "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": @@ -1758,7 +1591,7 @@ func (o *ZitiEdgeAPI) ProducersFor(mediaTypes []string) map[string]runtime.Produ } // HandlerFor gets a http.Handler for the provided operation method and path -func (o *ZitiEdgeAPI) HandlerFor(method, path string) (http.Handler, bool) { +func (o *ZitiEdgeManagementAPI) HandlerFor(method, path string) (http.Handler, bool) { if o.handlers == nil { return nil, false } @@ -1773,8 +1606,8 @@ func (o *ZitiEdgeAPI) HandlerFor(method, path string) (http.Handler, bool) { return h, ok } -// Context returns the middleware context for the ziti edge API -func (o *ZitiEdgeAPI) Context() *middleware.Context { +// 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) } @@ -1782,7 +1615,7 @@ func (o *ZitiEdgeAPI) Context() *middleware.Context { return o.context } -func (o *ZitiEdgeAPI) initHandlerCache() { +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) @@ -1827,10 +1660,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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"]["/database/snapshot"] = database.NewCreateDatabaseSnapshot(o.context, o.DatabaseCreateDatabaseSnapshotHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) @@ -1855,11 +1684,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) + o.handlers["POST"]["/routers"] = router.NewCreateRouter(o.context, o.RouterCreateRouterHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) } @@ -1875,15 +1700,11 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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["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"] = transit_router.NewCreateTransitRouter(o.context, o.TransitRouterCreateTransitRouterHandler) + o.handlers["POST"]["/transit-routers"] = router.NewCreateTransitRouter(o.context, o.RouterCreateTransitRouterHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } @@ -1911,10 +1732,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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"]["/edge-routers/{id}"] = edge_router.NewDeleteEdgeRouter(o.context, o.EdgeRouterDeleteEdgeRouterHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) @@ -1939,6 +1756,10 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -1959,7 +1780,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } - o.handlers["DELETE"]["/transit-routers/{id}"] = transit_router.NewDeleteTransitRouter(o.context, o.TransitRouterDeleteTransitRouterHandler) + 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) } @@ -1983,10 +1804,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2003,10 +1820,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/geo-regions/{id}"] = geo_region.NewDetailGeoRegion(o.context, o.GeoRegionDetailGeoRegionHandler) - 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) @@ -2035,6 +1848,10 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2067,7 +1884,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/transit-routers/{id}"] = transit_router.NewDetailTransitRouter(o.context, o.TransitRouterDetailTransitRouterHandler) + o.handlers["GET"]["/transit-routers/{id}"] = router.NewDetailTransitRouter(o.context, o.RouterDetailTransitRouterHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } @@ -2075,38 +1892,10 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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"]["/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"]["/database/fix-data-integrity"] = database.NewFixDataIntegrity(o.context, o.DatabaseFixDataIntegrityHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) @@ -2123,10 +1912,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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"]["/identities/{id}/failed-service-requests"] = identity.NewGetIdentityFailedServiceRequests(o.context, o.IdentityGetIdentityFailedServiceRequestsHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) @@ -2163,10 +1948,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2211,10 +1992,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/geo-regions"] = geo_region.NewListGeoRegions(o.context, o.GeoRegionListGeoRegionsHandler) - 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) @@ -2255,11 +2032,11 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/protocols"] = informational.NewListProtocols(o.context, o.InformationalListProtocolsHandler) + 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"][""] = informational.NewListRoot(o.context, o.InformationalListRootHandler) + o.handlers["GET"]["/routers"] = router.NewListRouters(o.context, o.RouterListRoutersHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } @@ -2319,10 +2096,6 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2343,15 +2116,11 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/transit-routers"] = transit_router.NewListTransitRouters(o.context, o.TransitRouterListTransitRoutersHandler) + 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["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) } @@ -2391,6 +2160,10 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2407,7 +2180,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["PATCH"] == nil { o.handlers["PATCH"] = make(map[string]http.Handler) } - o.handlers["PATCH"]["/transit-routers/{id}"] = transit_router.NewPatchTransitRouter(o.context, o.TransitRouterPatchTransitRouterHandler) + o.handlers["PATCH"]["/transit-routers/{id}"] = router.NewPatchTransitRouter(o.context, o.RouterPatchTransitRouterHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } @@ -2451,6 +2224,10 @@ func (o *ZitiEdgeAPI) initHandlerCache() { 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) @@ -2467,7 +2244,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { if o.handlers["PUT"] == nil { o.handlers["PUT"] = make(map[string]http.Handler) } - o.handlers["PUT"]["/transit-routers/{id}"] = transit_router.NewUpdateTransitRouter(o.context, o.TransitRouterUpdateTransitRouterHandler) + 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) } @@ -2480,7 +2257,7 @@ func (o *ZitiEdgeAPI) initHandlerCache() { // Serve creates a http handler to serve the API over HTTP // can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *ZitiEdgeAPI) Serve(builder middleware.Builder) http.Handler { +func (o *ZitiEdgeManagementAPI) Serve(builder middleware.Builder) http.Handler { o.Init() if o.Middleware != nil { @@ -2493,24 +2270,24 @@ func (o *ZitiEdgeAPI) Serve(builder middleware.Builder) http.Handler { } // Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *ZitiEdgeAPI) Init() { +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 *ZitiEdgeAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { +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 *ZitiEdgeAPI) RegisterProducer(mediaType string, producer runtime.Producer) { +func (o *ZitiEdgeManagementAPI) RegisterProducer(mediaType string, producer runtime.Producer) { o.customProducers[mediaType] = producer } // AddMiddlewareFor adds a http middleware to existing handler -func (o *ZitiEdgeAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { +func (o *ZitiEdgeManagementAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { um := strings.ToUpper(method) if path == "/" { path = "" diff --git a/rest_management_api_server/server.go b/rest_management_api_server/server.go new file mode 100644 index 000000000..014cdd692 --- /dev/null +++ b/rest_management_api_server/server.go @@ -0,0 +1,535 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// +// Copyright NetFoundry, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// 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") + } + + // must have at least one certificate or panics + httpsServer.TLSConfig.BuildNameToCertificate() + + 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 index 604936618..55dae018c 100644 --- a/rest_model/api_error.go +++ b/rest_model/api_error.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -81,7 +83,6 @@ func (m *APIError) Validate(formats strfmt.Registry) error { } func (m *APIError) validateArgs(formats strfmt.Registry) error { - if swag.IsZero(m.Args) { // not required return nil } @@ -99,7 +100,6 @@ func (m *APIError) validateArgs(formats strfmt.Registry) error { } func (m *APIError) validateCause(formats strfmt.Registry) error { - if swag.IsZero(m.Cause) { // not required return nil } @@ -116,6 +116,52 @@ func (m *APIError) validateCause(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *APIError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/api_error_args.go b/rest_model/api_error_args.go index 680fb8b46..0fa1a2e98 100644 --- a/rest_model/api_error_args.go +++ b/rest_model/api_error_args.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -48,6 +50,11 @@ 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 { diff --git a/rest_model/api_error_cause.go b/rest_model/api_error_cause.go index b6647e069..37ed6a17e 100644 --- a/rest_model/api_error_cause.go +++ b/rest_model/api_error_cause.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -100,6 +102,25 @@ func (m *APIErrorCause) Validate(formats strfmt.Registry) error { 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 { diff --git a/rest_model/api_error_envelope.go b/rest_model/api_error_envelope.go index 3f4490073..c5c60e0f9 100644 --- a/rest_model/api_error_envelope.go +++ b/rest_model/api_error_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *APIErrorEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *APIErrorEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/api_field_error.go b/rest_model/api_field_error.go index eac6dcb9b..aeeedf5c0 100644 --- a/rest_model/api_field_error.go +++ b/rest_model/api_field_error.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -54,6 +56,11 @@ 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 { diff --git a/rest_model/api_session_detail.go b/rest_model/api_session_detail.go index da61d445c..585d13431 100644 --- a/rest_model/api_session_detail.go +++ b/rest_model/api_session_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -369,6 +371,55 @@ func (m *APISessionDetail) validateToken(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *APISessionDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/api_session_list.go b/rest_model/api_session_list.go index 09123519f..457066c28 100644 --- a/rest_model/api_session_list.go +++ b/rest_model/api_session_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m APISessionList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index dd0179d20..d576c45c1 100644 --- a/rest_model/api_session_posture_data.go +++ b/rest_model/api_session_posture_data.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -78,6 +80,34 @@ func (m *APISessionPostureData) validateMfa(formats strfmt.Registry) error { 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.contextValidateMfa(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *APISessionPostureData) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/api_version.go b/rest_model/api_version.go index f2d789754..3e5dfaecd 100644 --- a/rest_model/api_version.go +++ b/rest_model/api_version.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -72,6 +74,11 @@ func (m *APIVersion) validatePath(formats strfmt.Registry) error { 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 { diff --git a/rest_model/attributes.go b/rest_model/attributes.go index 1d9939232..dbd4fe45b 100644 --- a/rest_model/attributes.go +++ b/rest_model/attributes.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type Attributes []string 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_query_detail.go b/rest_model/auth_query_detail.go index a789a9b38..6c7c934b4 100644 --- a/rest_model/auth_query_detail.go +++ b/rest_model/auth_query_detail.go @@ -30,9 +30,12 @@ package rest_model // 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 @@ -57,7 +60,7 @@ type AuthQueryDetail struct { // provider // Required: true - Provider MfaProviders `json:"provider"` + Provider *MfaProviders `json:"provider"` // type Id TypeID string `json:"typeId,omitempty"` @@ -82,7 +85,6 @@ func (m *AuthQueryDetail) Validate(formats strfmt.Registry) error { } func (m *AuthQueryDetail) validateFormat(formats strfmt.Registry) error { - if swag.IsZero(m.Format) { // not required return nil } @@ -99,9 +101,49 @@ func (m *AuthQueryDetail) validateFormat(formats strfmt.Registry) error { func (m *AuthQueryDetail) validateProvider(formats strfmt.Registry) error { - if err := m.Provider.Validate(formats); err != nil { + 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") + } + 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("provider") + return ve.ValidateName("format") } return err } @@ -109,6 +151,20 @@ func (m *AuthQueryDetail) validateProvider(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *AuthQueryDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/auth_query_list.go b/rest_model/auth_query_list.go index b8fd558a0..5412ce87a 100644 --- a/rest_model/auth_query_list.go +++ b/rest_model/auth_query_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m AuthQueryList) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/authenticate.go b/rest_model/authenticate.go index 36188f003..21e8eb1ec 100644 --- a/rest_model/authenticate.go +++ b/rest_model/authenticate.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -87,7 +89,6 @@ func (m *Authenticate) Validate(formats strfmt.Registry) error { } func (m *Authenticate) validateConfigTypes(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigTypes) { // not required return nil } @@ -103,7 +104,6 @@ func (m *Authenticate) validateConfigTypes(formats strfmt.Registry) error { } func (m *Authenticate) validateEnvInfo(formats strfmt.Registry) error { - if swag.IsZero(m.EnvInfo) { // not required return nil } @@ -121,7 +121,6 @@ func (m *Authenticate) validateEnvInfo(formats strfmt.Registry) error { } func (m *Authenticate) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required return nil } @@ -137,7 +136,6 @@ func (m *Authenticate) validatePassword(formats strfmt.Registry) error { } func (m *Authenticate) validateSdkInfo(formats strfmt.Registry) error { - if swag.IsZero(m.SdkInfo) { // not required return nil } @@ -155,7 +153,6 @@ func (m *Authenticate) validateSdkInfo(formats strfmt.Registry) error { } func (m *Authenticate) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required return nil } @@ -170,6 +167,100 @@ func (m *Authenticate) validateUsername(formats strfmt.Registry) error { 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *Authenticate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/authenticator_create.go b/rest_model/authenticator_create.go index 984e144d6..b3f8e0202 100644 --- a/rest_model/authenticator_create.go +++ b/rest_model/authenticator_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -119,16 +121,17 @@ func (m *AuthenticatorCreate) validatePassword(formats strfmt.Registry) error { } func (m *AuthenticatorCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -143,6 +146,32 @@ func (m *AuthenticatorCreate) validateUsername(formats strfmt.Registry) error { 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 err := m.Tags.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *AuthenticatorCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/authenticator_detail.go b/rest_model/authenticator_detail.go index 127c9fd12..a05e4ad3f 100644 --- a/rest_model/authenticator_detail.go +++ b/rest_model/authenticator_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -212,6 +214,39 @@ func (m *AuthenticatorDetail) validateMethod(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *AuthenticatorDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/authenticator_list.go b/rest_model/authenticator_list.go index 296b97a21..5329fd7b7 100644 --- a/rest_model/authenticator_list.go +++ b/rest_model/authenticator_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m AuthenticatorList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 1524d1557..ab266e784 100644 --- a/rest_model/authenticator_patch.go +++ b/rest_model/authenticator_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -73,7 +75,6 @@ func (m *AuthenticatorPatch) Validate(formats strfmt.Registry) error { } func (m *AuthenticatorPatch) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required return nil } @@ -91,12 +92,78 @@ func (m *AuthenticatorPatch) validatePassword(formats strfmt.Registry) error { } func (m *AuthenticatorPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + } + + return nil +} + +func (m *AuthenticatorPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -106,14 +173,10 @@ func (m *AuthenticatorPatch) validateTags(formats strfmt.Registry) error { return nil } -func (m *AuthenticatorPatch) validateUsername(formats strfmt.Registry) error { - - if swag.IsZero(m.Username) { // not required - return nil - } +func (m *AuthenticatorPatch) contextValidateUsername(ctx context.Context, formats strfmt.Registry) error { if m.Username != nil { - if err := m.Username.Validate(formats); err != nil { + if err := m.Username.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("username") } diff --git a/rest_model/authenticator_patch_with_current.go b/rest_model/authenticator_patch_with_current.go index e449bf021..1e330c84f 100644 --- a/rest_model/authenticator_patch_with_current.go +++ b/rest_model/authenticator_patch_with_current.go @@ -30,9 +30,12 @@ package rest_model // 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 @@ -43,7 +46,7 @@ type AuthenticatorPatchWithCurrent struct { // current password // Required: true - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } // UnmarshalJSON unmarshals this object from a JSON structure @@ -57,7 +60,7 @@ func (m *AuthenticatorPatchWithCurrent) UnmarshalJSON(raw []byte) error { // AO1 var dataAO1 struct { - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err @@ -78,7 +81,7 @@ func (m AuthenticatorPatchWithCurrent) MarshalJSON() ([]byte, error) { } _parts = append(_parts, aO0) var dataAO1 struct { - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } dataAO1.CurrentPassword = m.CurrentPassword @@ -112,13 +115,56 @@ func (m *AuthenticatorPatchWithCurrent) Validate(formats strfmt.Registry) error func (m *AuthenticatorPatchWithCurrent) validateCurrentPassword(formats strfmt.Registry) error { - if err := m.CurrentPassword.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } + 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") + } + 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") + } + return err + } + } + return nil } diff --git a/rest_model/authenticator_update.go b/rest_model/authenticator_update.go index 58dfc7674..bc730c3a6 100644 --- a/rest_model/authenticator_update.go +++ b/rest_model/authenticator_update.go @@ -30,9 +30,12 @@ package rest_model // 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 @@ -42,14 +45,14 @@ type AuthenticatorUpdate struct { // password // Required: true - Password Password `json:"password"` + Password *Password `json:"password"` // tags Tags Tags `json:"tags"` // username // Required: true - Username Username `json:"username"` + Username *Username `json:"username"` } // Validate validates this authenticator update @@ -76,23 +79,104 @@ func (m *AuthenticatorUpdate) Validate(formats strfmt.Registry) error { func (m *AuthenticatorUpdate) validatePassword(formats strfmt.Registry) error { - if err := m.Password.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } + 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") + } + return err + } + } + return nil } func (m *AuthenticatorUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + } + + return nil +} + +func (m *AuthenticatorUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -102,13 +186,15 @@ func (m *AuthenticatorUpdate) validateTags(formats strfmt.Registry) error { return nil } -func (m *AuthenticatorUpdate) validateUsername(formats strfmt.Registry) error { +func (m *AuthenticatorUpdate) contextValidateUsername(ctx context.Context, formats strfmt.Registry) error { - if err := m.Username.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") + if m.Username != nil { + if err := m.Username.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("username") + } + return err } - return err } return nil diff --git a/rest_model/authenticator_update_with_current.go b/rest_model/authenticator_update_with_current.go index aabc7a6e6..933f16428 100644 --- a/rest_model/authenticator_update_with_current.go +++ b/rest_model/authenticator_update_with_current.go @@ -30,9 +30,12 @@ package rest_model // 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 @@ -43,7 +46,7 @@ type AuthenticatorUpdateWithCurrent struct { // current password // Required: true - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } // UnmarshalJSON unmarshals this object from a JSON structure @@ -57,7 +60,7 @@ func (m *AuthenticatorUpdateWithCurrent) UnmarshalJSON(raw []byte) error { // AO1 var dataAO1 struct { - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err @@ -78,7 +81,7 @@ func (m AuthenticatorUpdateWithCurrent) MarshalJSON() ([]byte, error) { } _parts = append(_parts, aO0) var dataAO1 struct { - CurrentPassword Password `json:"currentPassword"` + CurrentPassword *Password `json:"currentPassword"` } dataAO1.CurrentPassword = m.CurrentPassword @@ -112,13 +115,56 @@ func (m *AuthenticatorUpdateWithCurrent) Validate(formats strfmt.Registry) error func (m *AuthenticatorUpdateWithCurrent) validateCurrentPassword(formats strfmt.Registry) error { - if err := m.CurrentPassword.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } + 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") + } + 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") + } + return err + } + } + return nil } diff --git a/rest_model/base_entity.go b/rest_model/base_entity.go index 11b8d05c5..f69fbb5a3 100644 --- a/rest_model/base_entity.go +++ b/rest_model/base_entity.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -96,13 +98,19 @@ func (m *BaseEntity) Validate(formats strfmt.Registry) error { func (m *BaseEntity) validateLinks(formats strfmt.Registry) error { - if err := m.Links.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } + 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") + } + return err + } + } + return nil } @@ -130,13 +138,19 @@ func (m *BaseEntity) validateID(formats strfmt.Registry) error { func (m *BaseEntity) validateTags(formats strfmt.Registry) error { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } + 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") + } + return err + } + } + return nil } @@ -153,6 +167,48 @@ func (m *BaseEntity) validateUpdatedAt(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} + +func (m *BaseEntity) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *BaseEntity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/ca_create.go b/rest_model/ca_create.go index 476164c1b..30ccdf75d 100644 --- a/rest_model/ca_create.go +++ b/rest_model/ca_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -42,6 +44,7 @@ import ( 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"` @@ -53,18 +56,22 @@ type CaCreate struct { 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"` @@ -172,12 +179,55 @@ func (m *CaCreate) validateName(formats strfmt.Registry) error { } func (m *CaCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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.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) 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") + } + return err + } + + return nil +} + +func (m *CaCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/ca_detail.go b/rest_model/ca_detail.go index 16bc12965..42e0ebe10 100644 --- a/rest_model/ca_detail.go +++ b/rest_model/ca_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -59,18 +61,22 @@ type CaDetail struct { 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"` @@ -356,6 +362,37 @@ func (m *CaDetail) validateVerificationToken(formats strfmt.Registry) error { 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.contextValidateIdentityRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CaDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/ca_list.go b/rest_model/ca_list.go index 92fd7cb41..033c9cf07 100644 --- a/rest_model/ca_list.go +++ b/rest_model/ca_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m CaList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index fd10fe17b..f709998c0 100644 --- a/rest_model/ca_patch.go +++ b/rest_model/ca_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -47,15 +49,19 @@ type CaPatch struct { 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 @@ -81,7 +87,6 @@ func (m *CaPatch) Validate(formats strfmt.Registry) error { } func (m *CaPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -97,12 +102,55 @@ func (m *CaPatch) validateIdentityRoles(formats strfmt.Registry) error { } func (m *CaPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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.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) 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") + } + return err + } + + return nil +} + +func (m *CaPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/ca_update.go b/rest_model/ca_update.go index 714bea89e..aec20ba36 100644 --- a/rest_model/ca_update.go +++ b/rest_model/ca_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -49,18 +51,22 @@ type CaUpdate struct { 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"` @@ -155,12 +161,55 @@ func (m *CaUpdate) validateName(formats strfmt.Registry) error { } func (m *CaUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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.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) 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") + } + return err + } + + return nil +} + +func (m *CaUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/common_edge_router_properties.go b/rest_model/common_edge_router_properties.go index d77aaed3d..911693e39 100644 --- a/rest_model/common_edge_router_properties.go +++ b/rest_model/common_edge_router_properties.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -100,16 +102,17 @@ func (m *CommonEdgeRouterProperties) Validate(formats strfmt.Registry) error { } func (m *CommonEdgeRouterProperties) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil @@ -144,6 +147,10 @@ func (m *CommonEdgeRouterProperties) validateName(formats strfmt.Registry) error func (m *CommonEdgeRouterProperties) validateSupportedProtocols(formats strfmt.Registry) error { + if err := validate.Required("supportedProtocols", "body", m.SupportedProtocols); err != nil { + return err + } + return nil } @@ -156,6 +163,32 @@ func (m *CommonEdgeRouterProperties) validateSyncStatus(formats strfmt.Registry) 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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *CommonEdgeRouterProperties) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/config_create.go b/rest_model/config_create.go index aed499c58..55df8cddf 100644 --- a/rest_model/config_create.go +++ b/rest_model/config_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,6 +39,7 @@ import ( ) // 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 { @@ -50,6 +53,7 @@ type ConfigCreate struct { Data interface{} `json:"data"` // name + // Example: default.ziti-tunneler-server.v1 // Required: true Name *string `json:"name"` @@ -94,6 +98,10 @@ func (m *ConfigCreate) validateConfigTypeID(formats strfmt.Registry) error { func (m *ConfigCreate) validateData(formats strfmt.Registry) error { + if m.Data == nil { + return errors.Required("data", "body", nil) + } + return nil } @@ -107,12 +115,39 @@ func (m *ConfigCreate) validateName(formats strfmt.Registry) error { } func (m *ConfigCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/config_detail.go b/rest_model/config_detail.go index 8128979ae..870d279c4 100644 --- a/rest_model/config_detail.go +++ b/rest_model/config_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -188,8 +190,8 @@ func (m *ConfigDetail) validateConfigTypeID(formats strfmt.Registry) error { func (m *ConfigDetail) validateData(formats strfmt.Registry) error { - if err := validate.Required("data", "body", m.Data); err != nil { - return err + if m.Data == nil { + return errors.Required("data", "body", nil) } return nil @@ -204,6 +206,39 @@ func (m *ConfigDetail) validateName(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ConfigDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/config_list.go b/rest_model/config_list.go index 967df5832..83fd4a9db 100644 --- a/rest_model/config_list.go +++ b/rest_model/config_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ConfigList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index b8fd3b294..c7b20a921 100644 --- a/rest_model/config_patch.go +++ b/rest_model/config_patch.go @@ -30,12 +30,15 @@ package rest_model // 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 { @@ -44,6 +47,7 @@ type ConfigPatch struct { Data interface{} `json:"data,omitempty"` // name + // Example: default.ziti-tunneler-server.v1 Name string `json:"name,omitempty"` // tags @@ -65,12 +69,39 @@ func (m *ConfigPatch) Validate(formats strfmt.Registry) error { } func (m *ConfigPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/config_type_create.go b/rest_model/config_type_create.go index a57f58b59..dc9d0c5c4 100644 --- a/rest_model/config_type_create.go +++ b/rest_model/config_type_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -42,6 +44,7 @@ import ( type ConfigTypeCreate struct { // name + // Example: ziti-tunneler-server.v1 // Required: true Name *string `json:"name"` @@ -80,12 +83,39 @@ func (m *ConfigTypeCreate) validateName(formats strfmt.Registry) error { } func (m *ConfigTypeCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/config_type_detail.go b/rest_model/config_type_detail.go index bb0218307..6c2bbb690 100644 --- a/rest_model/config_type_detail.go +++ b/rest_model/config_type_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -43,6 +45,7 @@ type ConfigTypeDetail struct { BaseEntity // name + // Example: ziti-tunneler-server.v1 // Required: true Name *string `json:"name"` @@ -138,6 +141,25 @@ func (m *ConfigTypeDetail) validateName(formats strfmt.Registry) error { 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 } diff --git a/rest_model/config_type_list.go b/rest_model/config_type_list.go index a766bc11f..0b84738c2 100644 --- a/rest_model/config_type_list.go +++ b/rest_model/config_type_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ConfigTypeList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 68cecb5c2..6c1c078ce 100644 --- a/rest_model/config_type_patch.go +++ b/rest_model/config_type_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -41,6 +43,7 @@ import ( type ConfigTypePatch struct { // name + // Example: ziti-tunneler-server.v1 Name string `json:"name,omitempty"` // A JSON schema to enforce configuration against @@ -65,12 +68,39 @@ func (m *ConfigTypePatch) Validate(formats strfmt.Registry) error { } func (m *ConfigTypePatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/config_type_update.go b/rest_model/config_type_update.go index 8d72b9c11..f5f0c8a1e 100644 --- a/rest_model/config_type_update.go +++ b/rest_model/config_type_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -42,6 +44,7 @@ import ( type ConfigTypeUpdate struct { // name + // Example: ziti-tunneler-server.v1 // Required: true Name *string `json:"name"` @@ -80,12 +83,39 @@ func (m *ConfigTypeUpdate) validateName(formats strfmt.Registry) error { } func (m *ConfigTypeUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/config_types.go b/rest_model/config_types.go index d3e496c27..ad4c11d01 100644 --- a/rest_model/config_types.go +++ b/rest_model/config_types.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type ConfigTypes []string 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 index e82203280..74e0e668f 100644 --- a/rest_model/config_update.go +++ b/rest_model/config_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,6 +39,7 @@ import ( ) // ConfigUpdate A config update object +// Example: {"data":{"hostname":"example.com","port":80},"name":"example-config-name"} // // swagger:model configUpdate type ConfigUpdate struct { @@ -46,6 +49,7 @@ type ConfigUpdate struct { Data interface{} `json:"data"` // name + // Example: default.ziti-tunneler-server.v1 // Required: true Name *string `json:"name"` @@ -77,6 +81,10 @@ func (m *ConfigUpdate) Validate(formats strfmt.Registry) error { func (m *ConfigUpdate) validateData(formats strfmt.Registry) error { + if m.Data == nil { + return errors.Required("data", "body", nil) + } + return nil } @@ -90,12 +98,39 @@ func (m *ConfigUpdate) validateName(formats strfmt.Registry) error { } func (m *ConfigUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/create_current_api_session_certificate_envelope.go b/rest_model/create_current_api_session_certificate_envelope.go index 19ec3d0b1..033a91c08 100644 --- a/rest_model/create_current_api_session_certificate_envelope.go +++ b/rest_model/create_current_api_session_certificate_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *CreateCurrentAPISessionCertificateEnvelope) validateMeta(formats strfmt 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CreateCurrentAPISessionCertificateEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/create_envelope.go b/rest_model/create_envelope.go index 8c18aa50c..49d40ab5b 100644 --- a/rest_model/create_envelope.go +++ b/rest_model/create_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -66,7 +68,6 @@ func (m *CreateEnvelope) Validate(formats strfmt.Registry) error { } func (m *CreateEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -84,7 +85,6 @@ func (m *CreateEnvelope) validateData(formats strfmt.Registry) error { } func (m *CreateEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required return nil } @@ -101,6 +101,52 @@ func (m *CreateEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CreateEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/create_location.go b/rest_model/create_location.go index 23e2f0d49..bd97431f9 100644 --- a/rest_model/create_location.go +++ b/rest_model/create_location.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,12 +64,39 @@ func (m *CreateLocation) Validate(formats strfmt.Registry) error { } func (m *CreateLocation) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } - if err := m.Links.Validate(formats); err != nil { + if m.Links != nil { + if err := m.Links.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") } diff --git a/rest_model/current_api_session_certificate_create.go b/rest_model/current_api_session_certificate_create.go index f33324291..8a31364a3 100644 --- a/rest_model/current_api_session_certificate_create.go +++ b/rest_model/current_api_session_certificate_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -69,6 +71,11 @@ func (m *CurrentAPISessionCertificateCreate) validateCsr(formats strfmt.Registry 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 { diff --git a/rest_model/current_api_session_certificate_create_response.go b/rest_model/current_api_session_certificate_create_response.go index f36e40206..00aacee2a 100644 --- a/rest_model/current_api_session_certificate_create_response.go +++ b/rest_model/current_api_session_certificate_create_response.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -131,6 +133,21 @@ func (m *CurrentAPISessionCertificateCreateResponse) validateCertificate(formats 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 { diff --git a/rest_model/current_api_session_certificate_detail.go b/rest_model/current_api_session_certificate_detail.go index 172eb4bff..db5f3b0dd 100644 --- a/rest_model/current_api_session_certificate_detail.go +++ b/rest_model/current_api_session_certificate_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -230,6 +232,21 @@ func (m *CurrentAPISessionCertificateDetail) validateValidTo(formats strfmt.Regi 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 { diff --git a/rest_model/current_api_session_certificate_list.go b/rest_model/current_api_session_certificate_list.go index 5300ca826..7bdba1d2b 100644 --- a/rest_model/current_api_session_certificate_list.go +++ b/rest_model/current_api_session_certificate_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m CurrentAPISessionCertificateList) Validate(formats strfmt.Registry) erro } 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)) + } + 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 index e4b3987d4..c47af445f 100644 --- a/rest_model/current_api_session_detail.go +++ b/rest_model/current_api_session_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -150,6 +152,21 @@ func (m *CurrentAPISessionDetail) validateExpiresAt(formats strfmt.Registry) 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 { diff --git a/rest_model/current_api_session_detail_envelope.go b/rest_model/current_api_session_detail_envelope.go index 386e8184e..6a3837675 100644 --- a/rest_model/current_api_session_detail_envelope.go +++ b/rest_model/current_api_session_detail_envelope.go @@ -30,15 +30,17 @@ package rest_model // 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 +// CurrentAPISessionDetailEnvelope current Api session detail envelope // -// swagger:model currentAPISessionDetailEnvelope +// swagger:model currentApiSessionDetailEnvelope type CurrentAPISessionDetailEnvelope struct { // data @@ -50,7 +52,7 @@ type CurrentAPISessionDetailEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this current API session detail envelope +// Validate validates this current Api session detail envelope func (m *CurrentAPISessionDetailEnvelope) Validate(formats strfmt.Registry) error { var res []error @@ -104,6 +106,52 @@ func (m *CurrentAPISessionDetailEnvelope) validateMeta(formats strfmt.Registry) 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CurrentAPISessionDetailEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/current_api_session_service_update_list.go b/rest_model/current_api_session_service_update_list.go index b6c2ff6b4..518ccaf3c 100644 --- a/rest_model/current_api_session_service_update_list.go +++ b/rest_model/current_api_session_service_update_list.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -38,7 +40,7 @@ import ( // CurrentAPISessionServiceUpdateList current Api session service update list // -// swagger:model CurrentApiSessionServiceUpdateList +// swagger:model currentApiSessionServiceUpdateList type CurrentAPISessionServiceUpdateList struct { // last change at @@ -74,6 +76,11 @@ func (m *CurrentAPISessionServiceUpdateList) validateLastChangeAt(formats strfmt 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 { diff --git a/rest_model/current_identity_detail_envelope.go b/rest_model/current_identity_detail_envelope.go index a9b72444f..b31aa39f2 100644 --- a/rest_model/current_identity_detail_envelope.go +++ b/rest_model/current_identity_detail_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *CurrentIdentityDetailEnvelope) validateMeta(formats strfmt.Registry) er 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CurrentIdentityDetailEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/current_identity_edge_router_detail.go b/rest_model/current_identity_edge_router_detail.go index 3ff443c2a..8b20739e2 100644 --- a/rest_model/current_identity_edge_router_detail.go +++ b/rest_model/current_identity_edge_router_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -100,6 +102,25 @@ func (m *CurrentIdentityEdgeRouterDetail) Validate(formats strfmt.Registry) erro 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 { diff --git a/rest_model/current_identity_edge_router_list.go b/rest_model/current_identity_edge_router_list.go index c8e5f4f18..690967b0a 100644 --- a/rest_model/current_identity_edge_router_list.go +++ b/rest_model/current_identity_edge_router_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m CurrentIdentityEdgeRouterList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 35dfbeae1..466f89b71 100644 --- a/rest_model/data_integrity_check_detail.go +++ b/rest_model/data_integrity_check_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -86,6 +88,11 @@ func (m *DataIntegrityCheckDetail) validateFixed(formats strfmt.Registry) error 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 { diff --git a/rest_model/data_integrity_check_detail_list.go b/rest_model/data_integrity_check_detail_list.go index c58c8deac..88c99e116 100644 --- a/rest_model/data_integrity_check_detail_list.go +++ b/rest_model/data_integrity_check_detail_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m DataIntegrityCheckDetailList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 599a8fb29..ee5ae41d3 100644 --- a/rest_model/data_integrity_check_details.go +++ b/rest_model/data_integrity_check_details.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -188,6 +190,32 @@ func (m *DataIntegrityCheckDetails) validateTooManyErrors(formats strfmt.Registr 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *DataIntegrityCheckDetails) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/data_integrity_check_result_envelope.go b/rest_model/data_integrity_check_result_envelope.go index 83fce303e..e3040f21d 100644 --- a/rest_model/data_integrity_check_result_envelope.go +++ b/rest_model/data_integrity_check_result_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DataIntegrityCheckResultEnvelope) validateMeta(formats strfmt.Registry) 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DataIntegrityCheckResultEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_api_session_envelope.go b/rest_model/detail_api_session_envelope.go index b5c1fdfb6..0d47d8638 100644 --- a/rest_model/detail_api_session_envelope.go +++ b/rest_model/detail_api_session_envelope.go @@ -30,15 +30,17 @@ package rest_model // 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 +// DetailAPISessionEnvelope detail Api session envelope // -// swagger:model detailAPISessionEnvelope +// swagger:model detailApiSessionEnvelope type DetailAPISessionEnvelope struct { // data @@ -50,7 +52,7 @@ type DetailAPISessionEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this detail API session envelope +// Validate validates this detail Api session envelope func (m *DetailAPISessionEnvelope) Validate(formats strfmt.Registry) error { var res []error @@ -104,6 +106,52 @@ func (m *DetailAPISessionEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailAPISessionEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_authenticator_envelope.go b/rest_model/detail_authenticator_envelope.go index 288733f84..4790b45e7 100644 --- a/rest_model/detail_authenticator_envelope.go +++ b/rest_model/detail_authenticator_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailAuthenticatorEnvelope) validateMeta(formats strfmt.Registry) erro 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailAuthenticatorEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_ca_envelope.go b/rest_model/detail_ca_envelope.go index 6ba51fafb..1519c383e 100644 --- a/rest_model/detail_ca_envelope.go +++ b/rest_model/detail_ca_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailCaEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailCaEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_config_envelope.go b/rest_model/detail_config_envelope.go index 06dc791e8..f8962de11 100644 --- a/rest_model/detail_config_envelope.go +++ b/rest_model/detail_config_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailConfigEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailConfigEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_config_type_envelope.go b/rest_model/detail_config_type_envelope.go index 84358d2eb..a249ea7df 100644 --- a/rest_model/detail_config_type_envelope.go +++ b/rest_model/detail_config_type_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailConfigTypeEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailConfigTypeEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_current_api_session_certificate_envelope.go b/rest_model/detail_current_api_session_certificate_envelope.go index 087599bb0..9a87cebe4 100644 --- a/rest_model/detail_current_api_session_certificate_envelope.go +++ b/rest_model/detail_current_api_session_certificate_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailCurrentAPISessionCertificateEnvelope) validateMeta(formats strfmt 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailCurrentAPISessionCertificateEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_edge_router_policy_envelope.go b/rest_model/detail_edge_router_policy_envelope.go index 9a8db5e80..968c65ea2 100644 --- a/rest_model/detail_edge_router_policy_envelope.go +++ b/rest_model/detail_edge_router_policy_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailEdgeRouterPolicyEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailEdgeRouterPolicyEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_enrollment_envelope.go b/rest_model/detail_enrollment_envelope.go index 764d6ce6c..0f4a0f782 100644 --- a/rest_model/detail_enrollment_envelope.go +++ b/rest_model/detail_enrollment_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailEnrollmentEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailEnrollmentEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_geo_region_envelope.go b/rest_model/detail_geo_region_envelope.go deleted file mode 100644 index ec4910ac0..000000000 --- a/rest_model/detail_geo_region_envelope.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 rest_model - -// 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/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailGeoRegionEnvelope detail geo region envelope -// -// swagger:model detailGeoRegionEnvelope -type DetailGeoRegionEnvelope struct { - - // data - // Required: true - Data *GeoRegionDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail geo region envelope -func (m *DetailGeoRegionEnvelope) 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 *DetailGeoRegionEnvelope) 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") - } - return err - } - } - - return nil -} - -func (m *DetailGeoRegionEnvelope) 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") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailGeoRegionEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailGeoRegionEnvelope) UnmarshalBinary(b []byte) error { - var res DetailGeoRegionEnvelope - 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 index aee8bd4c1..978802dc6 100644 --- a/rest_model/detail_identity_envelope.go +++ b/rest_model/detail_identity_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailIdentityEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailIdentityEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_identity_type_envelope.go b/rest_model/detail_identity_type_envelope.go index 81ac3f832..2b75e71cd 100644 --- a/rest_model/detail_identity_type_envelope.go +++ b/rest_model/detail_identity_type_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailIdentityTypeEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailIdentityTypeEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_mfa.go b/rest_model/detail_mfa.go index a36f7dd35..8cd1ed87b 100644 --- a/rest_model/detail_mfa.go +++ b/rest_model/detail_mfa.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -142,6 +144,21 @@ func (m *DetailMfa) validateIsVerified(formats strfmt.Registry) error { 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 { diff --git a/rest_model/detail_mfa_envelope.go b/rest_model/detail_mfa_envelope.go index 31d951231..b53efe42c 100644 --- a/rest_model/detail_mfa_envelope.go +++ b/rest_model/detail_mfa_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailMfaEnvelope) validateMeta(formats strfmt.Registry) error { 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.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 *DetailMfaEnvelope) 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailMfaEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_mfa_recovery_codes.go b/rest_model/detail_mfa_recovery_codes.go index 5ca5396ab..a1ae8c9ab 100644 --- a/rest_model/detail_mfa_recovery_codes.go +++ b/rest_model/detail_mfa_recovery_codes.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -120,6 +122,21 @@ func (m *DetailMfaRecoveryCodes) validateRecoveryCodes(formats strfmt.Registry) 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 { diff --git a/rest_model/detail_mfa_recovery_codes_envelope.go b/rest_model/detail_mfa_recovery_codes_envelope.go index 2b76be6d3..13f99e5e3 100644 --- a/rest_model/detail_mfa_recovery_codes_envelope.go +++ b/rest_model/detail_mfa_recovery_codes_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailMfaRecoveryCodesEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailMfaRecoveryCodesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_posture_check_envelope.go b/rest_model/detail_posture_check_envelope.go index 85d05bbea..19d4ba6e4 100644 --- a/rest_model/detail_posture_check_envelope.go +++ b/rest_model/detail_posture_check_envelope.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" @@ -173,6 +174,50 @@ func (m *DetailPostureCheckEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailPostureCheckEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_posture_check_type_envelope.go b/rest_model/detail_posture_check_type_envelope.go index f44ddbe00..619d9d275 100644 --- a/rest_model/detail_posture_check_type_envelope.go +++ b/rest_model/detail_posture_check_type_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailPostureCheckTypeEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailPostureCheckTypeEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_transit_router_envelope.go b/rest_model/detail_router_envelope.go similarity index 59% rename from rest_model/detail_transit_router_envelope.go rename to rest_model/detail_router_envelope.go index a34ad1446..be738e9be 100644 --- a/rest_model/detail_transit_router_envelope.go +++ b/rest_model/detail_router_envelope.go @@ -30,28 +30,30 @@ package rest_model // 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" ) -// DetailTransitRouterEnvelope detail transit router envelope +// DetailRouterEnvelope detail router envelope // -// swagger:model detailTransitRouterEnvelope -type DetailTransitRouterEnvelope struct { +// swagger:model detailRouterEnvelope +type DetailRouterEnvelope struct { // data // Required: true - Data *TransitRouterDetail `json:"data"` + Data *RouterDetail `json:"data"` // meta // Required: true Meta *Meta `json:"meta"` } -// Validate validates this detail transit router envelope -func (m *DetailTransitRouterEnvelope) Validate(formats strfmt.Registry) error { +// Validate validates this detail router envelope +func (m *DetailRouterEnvelope) Validate(formats strfmt.Registry) error { var res []error if err := m.validateData(formats); err != nil { @@ -68,7 +70,7 @@ func (m *DetailTransitRouterEnvelope) Validate(formats strfmt.Registry) error { return nil } -func (m *DetailTransitRouterEnvelope) validateData(formats strfmt.Registry) error { +func (m *DetailRouterEnvelope) validateData(formats strfmt.Registry) error { if err := validate.Required("data", "body", m.Data); err != nil { return err @@ -86,7 +88,7 @@ func (m *DetailTransitRouterEnvelope) validateData(formats strfmt.Registry) erro return nil } -func (m *DetailTransitRouterEnvelope) validateMeta(formats strfmt.Registry) error { +func (m *DetailRouterEnvelope) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -104,8 +106,54 @@ func (m *DetailTransitRouterEnvelope) validateMeta(formats strfmt.Registry) erro 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *DetailTransitRouterEnvelope) MarshalBinary() ([]byte, error) { +func (m *DetailRouterEnvelope) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -113,8 +161,8 @@ func (m *DetailTransitRouterEnvelope) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *DetailTransitRouterEnvelope) UnmarshalBinary(b []byte) error { - var res DetailTransitRouterEnvelope +func (m *DetailRouterEnvelope) UnmarshalBinary(b []byte) error { + var res DetailRouterEnvelope if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/detail_service_edge_policy_envelope.go b/rest_model/detail_service_edge_policy_envelope.go index 0a8df42fc..c3ebb158b 100644 --- a/rest_model/detail_service_edge_policy_envelope.go +++ b/rest_model/detail_service_edge_policy_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailServiceEdgePolicyEnvelope) validateMeta(formats strfmt.Registry) 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailServiceEdgePolicyEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_service_envelope.go b/rest_model/detail_service_envelope.go index 28807f9cf..57d8ca40e 100644 --- a/rest_model/detail_service_envelope.go +++ b/rest_model/detail_service_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailServiceEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailServiceEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_service_policy_envelop.go b/rest_model/detail_service_policy_envelop.go index a3e8ae59c..7e34efb54 100644 --- a/rest_model/detail_service_policy_envelop.go +++ b/rest_model/detail_service_policy_envelop.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailServicePolicyEnvelop) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailServicePolicyEnvelop) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_session_envelope.go b/rest_model/detail_session_envelope.go index c19fc138e..85d6191e2 100644 --- a/rest_model/detail_session_envelope.go +++ b/rest_model/detail_session_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailSessionEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailSessionEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_session_route_path_envelope.go b/rest_model/detail_session_route_path_envelope.go index 578f0bce4..c4e2ac5bc 100644 --- a/rest_model/detail_session_route_path_envelope.go +++ b/rest_model/detail_session_route_path_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailSessionRoutePathEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailSessionRoutePathEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_spec_body_envelope.go b/rest_model/detail_spec_body_envelope.go index af5e87b9c..3625fbd70 100644 --- a/rest_model/detail_spec_body_envelope.go +++ b/rest_model/detail_spec_body_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -43,7 +45,7 @@ type DetailSpecBodyEnvelope struct { // data // Required: true - Data SpecBodyDetail `json:"data"` + Data *SpecBodyDetail `json:"data"` // meta // Required: true @@ -70,13 +72,23 @@ func (m *DetailSpecBodyEnvelope) Validate(formats strfmt.Registry) error { func (m *DetailSpecBodyEnvelope) validateData(formats strfmt.Registry) error { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } + 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") + } + return err + } + } + return nil } @@ -98,6 +110,52 @@ func (m *DetailSpecBodyEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailSpecBodyEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_spec_envelope.go b/rest_model/detail_spec_envelope.go index 11e23c84e..5bd32b117 100644 --- a/rest_model/detail_spec_envelope.go +++ b/rest_model/detail_spec_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailSpecEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailSpecEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detail_terminator_envelope.go b/rest_model/detail_terminator_envelope.go index ce0766093..bb603e513 100644 --- a/rest_model/detail_terminator_envelope.go +++ b/rest_model/detail_terminator_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailTerminatorEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailTerminatorEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/detailed_edge_router_envelope.go b/rest_model/detailed_edge_router_envelope.go index a63f4e49b..99edbf86d 100644 --- a/rest_model/detailed_edge_router_envelope.go +++ b/rest_model/detailed_edge_router_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *DetailedEdgeRouterEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DetailedEdgeRouterEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/dial_bind.go b/rest_model/dial_bind.go index 1ecefca6b..ddcf4dc1d 100644 --- a/rest_model/dial_bind.go +++ b/rest_model/dial_bind.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model dialBind type DialBind string +func NewDialBind(value DialBind) *DialBind { + v := value + return &v +} + const ( // DialBindDial captures enum value "Dial" @@ -85,3 +91,8 @@ func (m DialBind) Validate(formats strfmt.Registry) error { } 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 index 8305ac791..2c7799dd9 100644 --- a/rest_model/dial_bind_array.go +++ b/rest_model/dial_bind_array.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -61,3 +62,24 @@ func (m DialBindArray) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/edge_router_create.go b/rest_model/edge_router_create.go index 4726cb2b2..4c3ccc952 100644 --- a/rest_model/edge_router_create.go +++ b/rest_model/edge_router_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -85,16 +87,17 @@ func (m *EdgeRouterCreate) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterCreate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil @@ -110,7 +113,6 @@ func (m *EdgeRouterCreate) validateName(formats strfmt.Registry) error { } func (m *EdgeRouterCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -126,12 +128,71 @@ func (m *EdgeRouterCreate) validateRoleAttributes(formats strfmt.Registry) error } func (m *EdgeRouterCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err + } + + return nil +} + +func (m *EdgeRouterCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *EdgeRouterCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/edge_router_detail.go b/rest_model/edge_router_detail.go index a7073470a..ae958dc19 100644 --- a/rest_model/edge_router_detail.go +++ b/rest_model/edge_router_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,6 +39,7 @@ import ( ) // 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"}},"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","roleAttributes":["eastCoast","sales","test"],"supportedProtocols":{},"tags":{},"updatedAt":"2020-03-16T17:13:31.5807454Z"} // // swagger:model edgeRouterDetail type EdgeRouterDetail struct { @@ -320,6 +323,59 @@ func (m *EdgeRouterDetail) validateVersionInfo(formats strfmt.Registry) error { 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 err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *EdgeRouterDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/edge_router_list.go b/rest_model/edge_router_list.go index 31845d714..29643711a 100644 --- a/rest_model/edge_router_list.go +++ b/rest_model/edge_router_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m EdgeRouterList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index b84a5738e..c38810c9f 100644 --- a/rest_model/edge_router_patch.go +++ b/rest_model/edge_router_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -79,23 +81,23 @@ func (m *EdgeRouterPatch) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterPatch) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil } func (m *EdgeRouterPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -111,12 +113,71 @@ func (m *EdgeRouterPatch) validateRoleAttributes(formats strfmt.Registry) error } func (m *EdgeRouterPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err + } + + return nil +} + +func (m *EdgeRouterPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *EdgeRouterPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/edge_router_policy_create.go b/rest_model/edge_router_policy_create.go index bc2e810cf..a7d86fe05 100644 --- a/rest_model/edge_router_policy_create.go +++ b/rest_model/edge_router_policy_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -89,7 +91,6 @@ func (m *EdgeRouterPolicyCreate) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterPolicyCreate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -105,7 +106,6 @@ func (m *EdgeRouterPolicyCreate) validateEdgeRouterRoles(formats strfmt.Registry } func (m *EdgeRouterPolicyCreate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -130,7 +130,6 @@ func (m *EdgeRouterPolicyCreate) validateName(formats strfmt.Registry) error { } func (m *EdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -146,12 +145,87 @@ func (m *EdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry) error } func (m *EdgeRouterPolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *EdgeRouterPolicyCreate) 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") + } + return err + } + + return nil +} + +func (m *EdgeRouterPolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/edge_router_policy_detail.go b/rest_model/edge_router_policy_detail.go index ad258c947..81f6671a7 100644 --- a/rest_model/edge_router_policy_detail.go +++ b/rest_model/edge_router_policy_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -68,7 +70,7 @@ type EdgeRouterPolicyDetail struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } // UnmarshalJSON unmarshals this object from a JSON structure @@ -94,7 +96,7 @@ func (m *EdgeRouterPolicyDetail) UnmarshalJSON(raw []byte) error { Name *string `json:"name"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err @@ -139,7 +141,7 @@ func (m EdgeRouterPolicyDetail) MarshalJSON() ([]byte, error) { Name *string `json:"name"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } dataAO1.EdgeRouterRoles = m.EdgeRouterRoles @@ -291,9 +293,66 @@ func (m *EdgeRouterPolicyDetail) validateName(formats strfmt.Registry) error { func (m *EdgeRouterPolicyDetail) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { + 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") + } + 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("semantic") + return ve.ValidateName("edgeRouterRoles") } return err } @@ -301,6 +360,56 @@ func (m *EdgeRouterPolicyDetail) validateSemantic(formats strfmt.Registry) error 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") + } + 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *EdgeRouterPolicyDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/edge_router_policy_list.go b/rest_model/edge_router_policy_list.go index 327ce9c28..74e2d59cd 100644 --- a/rest_model/edge_router_policy_list.go +++ b/rest_model/edge_router_policy_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m EdgeRouterPolicyList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 04b594d1a..55982ef28 100644 --- a/rest_model/edge_router_policy_patch.go +++ b/rest_model/edge_router_policy_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -83,7 +85,6 @@ func (m *EdgeRouterPolicyPatch) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -99,7 +100,6 @@ func (m *EdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Registry) } func (m *EdgeRouterPolicyPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -115,7 +115,6 @@ func (m *EdgeRouterPolicyPatch) validateIdentityRoles(formats strfmt.Registry) e } func (m *EdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -131,12 +130,87 @@ func (m *EdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) error } func (m *EdgeRouterPolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + return err + } + + return nil +} + +func (m *EdgeRouterPolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/edge_router_policy_update.go b/rest_model/edge_router_policy_update.go index 57d963038..91efd0ba9 100644 --- a/rest_model/edge_router_policy_update.go +++ b/rest_model/edge_router_policy_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -89,7 +91,6 @@ func (m *EdgeRouterPolicyUpdate) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterPolicyUpdate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -105,7 +106,6 @@ func (m *EdgeRouterPolicyUpdate) validateEdgeRouterRoles(formats strfmt.Registry } func (m *EdgeRouterPolicyUpdate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -130,7 +130,6 @@ func (m *EdgeRouterPolicyUpdate) validateName(formats strfmt.Registry) error { } func (m *EdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -146,12 +145,87 @@ func (m *EdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry) error } func (m *EdgeRouterPolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *EdgeRouterPolicyUpdate) 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") + } + return err + } + + return nil +} + +func (m *EdgeRouterPolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/edge_router_update.go b/rest_model/edge_router_update.go index e40c52766..7539d5997 100644 --- a/rest_model/edge_router_update.go +++ b/rest_model/edge_router_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -85,16 +87,17 @@ func (m *EdgeRouterUpdate) Validate(formats strfmt.Registry) error { } func (m *EdgeRouterUpdate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil @@ -110,7 +113,6 @@ func (m *EdgeRouterUpdate) validateName(formats strfmt.Registry) error { } func (m *EdgeRouterUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -126,12 +128,71 @@ func (m *EdgeRouterUpdate) validateRoleAttributes(formats strfmt.Registry) error } func (m *EdgeRouterUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err + } + + return nil +} + +func (m *EdgeRouterUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *EdgeRouterUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/empty.go b/rest_model/empty.go index 555e47714..0e8b67e39 100644 --- a/rest_model/empty.go +++ b/rest_model/empty.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -42,6 +44,7 @@ import ( type Empty struct { // data + // Example: {} // Required: true Data interface{} `json:"data"` @@ -70,8 +73,8 @@ func (m *Empty) Validate(formats strfmt.Registry) error { func (m *Empty) validateData(formats strfmt.Registry) error { - if err := validate.Required("data", "body", m.Data); err != nil { - return err + if m.Data == nil { + return errors.Required("data", "body", nil) } return nil @@ -95,6 +98,34 @@ func (m *Empty) validateMeta(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Empty) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/enrollment_certs.go b/rest_model/enrollment_certs.go index 6f5b192fa..5389fcd4e 100644 --- a/rest_model/enrollment_certs.go +++ b/rest_model/enrollment_certs.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -54,6 +56,11 @@ 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 { diff --git a/rest_model/enrollment_certs_envelope.go b/rest_model/enrollment_certs_envelope.go index 281abb9f9..0cb13988b 100644 --- a/rest_model/enrollment_certs_envelope.go +++ b/rest_model/enrollment_certs_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -66,7 +68,6 @@ func (m *EnrollmentCertsEnvelope) Validate(formats strfmt.Registry) error { } func (m *EnrollmentCertsEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -84,7 +85,6 @@ func (m *EnrollmentCertsEnvelope) validateData(formats strfmt.Registry) error { } func (m *EnrollmentCertsEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required return nil } @@ -101,6 +101,52 @@ func (m *EnrollmentCertsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *EnrollmentCertsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/enrollment_detail.go b/rest_model/enrollment_detail.go index 41747107d..fed3f701a 100644 --- a/rest_model/enrollment_detail.go +++ b/rest_model/enrollment_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -40,6 +42,7 @@ import ( // 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 { @@ -254,6 +257,10 @@ func (m *EnrollmentDetail) Validate(formats strfmt.Registry) error { func (m *EnrollmentDetail) validateDetails(formats strfmt.Registry) error { + if err := validate.Required("details", "body", m.Details); err != nil { + return err + } + return nil } @@ -342,6 +349,75 @@ func (m *EnrollmentDetail) validateTransitRouter(formats strfmt.Registry) error 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *EnrollmentDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/enrollment_list.go b/rest_model/enrollment_list.go index 81853781d..eb896fce0 100644 --- a/rest_model/enrollment_list.go +++ b/rest_model/enrollment_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m EnrollmentList) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/entity_ref.go b/rest_model/entity_ref.go index 94aa734f2..bb38e3bb6 100644 --- a/rest_model/entity_ref.go +++ b/rest_model/entity_ref.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -68,12 +70,39 @@ func (m *EntityRef) Validate(formats strfmt.Registry) error { } func (m *EntityRef) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required return nil } - if err := m.Links.Validate(formats); err != nil { + if m.Links != nil { + if err := m.Links.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") } diff --git a/rest_model/env_info.go b/rest_model/env_info.go index af5080966..ea190e6ff 100644 --- a/rest_model/env_info.go +++ b/rest_model/env_info.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -57,6 +59,11 @@ 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 { diff --git a/rest_model/failed_session_request.go b/rest_model/failed_service_request.go similarity index 64% rename from rest_model/failed_session_request.go rename to rest_model/failed_service_request.go index 4aae60646..f3ae08370 100644 --- a/rest_model/failed_session_request.go +++ b/rest_model/failed_service_request.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -38,10 +39,10 @@ import ( "github.com/go-openapi/validate" ) -// FailedSessionRequest failed session request +// FailedServiceRequest failed service request // -// swagger:model failedSessionRequest -type FailedSessionRequest struct { +// swagger:model failedServiceRequest +type FailedServiceRequest struct { // api session Id APISessionID string `json:"apiSessionId,omitempty"` @@ -63,8 +64,8 @@ type FailedSessionRequest struct { When strfmt.DateTime `json:"when,omitempty"` } -// Validate validates this failed session request -func (m *FailedSessionRequest) Validate(formats strfmt.Registry) error { +// Validate validates this failed service request +func (m *FailedServiceRequest) Validate(formats strfmt.Registry) error { var res []error if err := m.validatePolicyFailures(formats); err != nil { @@ -85,8 +86,7 @@ func (m *FailedSessionRequest) Validate(formats strfmt.Registry) error { return nil } -func (m *FailedSessionRequest) validatePolicyFailures(formats strfmt.Registry) error { - +func (m *FailedServiceRequest) validatePolicyFailures(formats strfmt.Registry) error { if swag.IsZero(m.PolicyFailures) { // not required return nil } @@ -110,8 +110,7 @@ func (m *FailedSessionRequest) validatePolicyFailures(formats strfmt.Registry) e return nil } -func (m *FailedSessionRequest) validateSessionType(formats strfmt.Registry) error { - +func (m *FailedServiceRequest) validateSessionType(formats strfmt.Registry) error { if swag.IsZero(m.SessionType) { // not required return nil } @@ -126,8 +125,7 @@ func (m *FailedSessionRequest) validateSessionType(formats strfmt.Registry) erro return nil } -func (m *FailedSessionRequest) validateWhen(formats strfmt.Registry) error { - +func (m *FailedServiceRequest) validateWhen(formats strfmt.Registry) error { if swag.IsZero(m.When) { // not required return nil } @@ -139,8 +137,56 @@ func (m *FailedSessionRequest) validateWhen(formats strfmt.Registry) error { 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)) + } + 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation -func (m *FailedSessionRequest) MarshalBinary() ([]byte, error) { +func (m *FailedServiceRequest) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -148,8 +194,8 @@ func (m *FailedSessionRequest) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *FailedSessionRequest) UnmarshalBinary(b []byte) error { - var res FailedSessionRequest +func (m *FailedServiceRequest) UnmarshalBinary(b []byte) error { + var res FailedServiceRequest if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/get_identity_failed_service_request_envelope.go b/rest_model/failed_service_request_envelope.go similarity index 58% rename from rest_model/get_identity_failed_service_request_envelope.go rename to rest_model/failed_service_request_envelope.go index 06a6be8ba..5e65362f6 100644 --- a/rest_model/get_identity_failed_service_request_envelope.go +++ b/rest_model/failed_service_request_envelope.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// GetIdentityFailedServiceRequestEnvelope get identity failed service request envelope +// FailedServiceRequestEnvelope failed service request envelope // -// swagger:model getIdentityFailedServiceRequestEnvelope -type GetIdentityFailedServiceRequestEnvelope struct { +// swagger:model failedServiceRequestEnvelope +type FailedServiceRequestEnvelope struct { // data // Required: true @@ -50,8 +52,8 @@ type GetIdentityFailedServiceRequestEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this get identity failed service request envelope -func (m *GetIdentityFailedServiceRequestEnvelope) Validate(formats strfmt.Registry) error { +// 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 { @@ -68,7 +70,7 @@ func (m *GetIdentityFailedServiceRequestEnvelope) Validate(formats strfmt.Regist return nil } -func (m *GetIdentityFailedServiceRequestEnvelope) validateData(formats strfmt.Registry) error { +func (m *FailedServiceRequestEnvelope) validateData(formats strfmt.Registry) error { if err := validate.Required("data", "body", m.Data); err != nil { return err @@ -84,7 +86,7 @@ func (m *GetIdentityFailedServiceRequestEnvelope) validateData(formats strfmt.Re return nil } -func (m *GetIdentityFailedServiceRequestEnvelope) validateMeta(formats strfmt.Registry) error { +func (m *FailedServiceRequestEnvelope) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,8 +104,52 @@ func (m *GetIdentityFailedServiceRequestEnvelope) validateMeta(formats strfmt.Re 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *GetIdentityFailedServiceRequestEnvelope) MarshalBinary() ([]byte, error) { +func (m *FailedServiceRequestEnvelope) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -111,8 +157,8 @@ func (m *GetIdentityFailedServiceRequestEnvelope) MarshalBinary() ([]byte, error } // UnmarshalBinary interface implementation -func (m *GetIdentityFailedServiceRequestEnvelope) UnmarshalBinary(b []byte) error { - var res GetIdentityFailedServiceRequestEnvelope +func (m *FailedServiceRequestEnvelope) UnmarshalBinary(b []byte) error { + var res FailedServiceRequestEnvelope if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/failed_service_request_list.go b/rest_model/failed_service_request_list.go index 7eedabea1..dd61f8e68 100644 --- a/rest_model/failed_service_request_list.go +++ b/rest_model/failed_service_request_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,7 @@ import ( // FailedServiceRequestList failed service request list // // swagger:model failedServiceRequestList -type FailedServiceRequestList []*FailedSessionRequest +type FailedServiceRequestList []*FailedServiceRequest // Validate validates this failed service request list func (m FailedServiceRequestList) Validate(formats strfmt.Registry) error { @@ -67,3 +68,26 @@ func (m FailedServiceRequestList) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/geo_region_detail.go b/rest_model/geo_region_detail.go deleted file mode 100644 index 1d3c752fa..000000000 --- a/rest_model/geo_region_detail.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// 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/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GeoRegionDetail geo region detail -// -// swagger:model geoRegionDetail -type GeoRegionDetail struct { - BaseEntity - - // name - // Required: true - Name *string `json:"name"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *GeoRegionDetail) 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 GeoRegionDetail) 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 geo region detail -func (m *GeoRegionDetail) 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 *GeoRegionDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GeoRegionDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GeoRegionDetail) UnmarshalBinary(b []byte) error { - var res GeoRegionDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/get_identity_policy_advice_envelope.go b/rest_model/get_identity_policy_advice_envelope.go index 9434abfb8..ce7593d05 100644 --- a/rest_model/get_identity_policy_advice_envelope.go +++ b/rest_model/get_identity_policy_advice_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *GetIdentityPolicyAdviceEnvelope) validateMeta(formats strfmt.Registry) 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *GetIdentityPolicyAdviceEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/identity_authenticators.go b/rest_model/identity_authenticators.go index 4eb1840b0..adc1fa01f 100644 --- a/rest_model/identity_authenticators.go +++ b/rest_model/identity_authenticators.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -66,7 +68,6 @@ func (m *IdentityAuthenticators) Validate(formats strfmt.Registry) error { } func (m *IdentityAuthenticators) validateCert(formats strfmt.Registry) error { - if swag.IsZero(m.Cert) { // not required return nil } @@ -84,7 +85,6 @@ func (m *IdentityAuthenticators) validateCert(formats strfmt.Registry) error { } func (m *IdentityAuthenticators) validateUpdb(formats strfmt.Registry) error { - if swag.IsZero(m.Updb) { // not required return nil } @@ -101,6 +101,52 @@ func (m *IdentityAuthenticators) validateUpdb(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IdentityAuthenticators) MarshalBinary() ([]byte, error) { if m == nil { @@ -133,6 +179,11 @@ 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 { @@ -165,6 +216,11 @@ 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 { diff --git a/rest_model/identity_create.go b/rest_model/identity_create.go index f0c0eaf38..d87ac19c8 100644 --- a/rest_model/identity_create.go +++ b/rest_model/identity_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -45,7 +47,7 @@ type IdentityCreate struct { AppData Tags `json:"appData"` // default hosting cost - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` // default hosting precedence DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -75,7 +77,7 @@ type IdentityCreate struct { // type // Required: true - Type IdentityType `json:"type"` + Type *IdentityType `json:"type"` } // Validate validates this identity create @@ -133,39 +135,40 @@ func (m *IdentityCreate) Validate(formats strfmt.Registry) error { } func (m *IdentityCreate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil } func (m *IdentityCreate) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required return nil } - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") + if m.DefaultHostingCost != nil { + if err := m.DefaultHostingCost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("defaultHostingCost") + } + return err } - return err } return nil } func (m *IdentityCreate) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required return nil } @@ -181,7 +184,6 @@ func (m *IdentityCreate) validateDefaultHostingPrecedence(formats strfmt.Registr } func (m *IdentityCreate) validateEnrollment(formats strfmt.Registry) error { - if swag.IsZero(m.Enrollment) { // not required return nil } @@ -217,7 +219,6 @@ func (m *IdentityCreate) validateName(formats strfmt.Registry) error { } func (m *IdentityCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -233,12 +234,191 @@ func (m *IdentityCreate) validateRoleAttributes(formats strfmt.Registry) error { } func (m *IdentityCreate) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required return nil } - if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if m.ServiceHostingCosts != nil { + if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + +func (m *IdentityCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") } @@ -248,13 +428,9 @@ func (m *IdentityCreate) validateServiceHostingCosts(formats strfmt.Registry) er return nil } -func (m *IdentityCreate) validateServiceHostingPrecedences(formats strfmt.Registry) error { +func (m *IdentityCreate) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { + if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("serviceHostingPrecedences") } @@ -264,13 +440,9 @@ func (m *IdentityCreate) validateServiceHostingPrecedences(formats strfmt.Regist return nil } -func (m *IdentityCreate) validateTags(formats strfmt.Registry) error { +func (m *IdentityCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if err := m.Tags.Validate(formats); err != nil { + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -280,13 +452,15 @@ func (m *IdentityCreate) validateTags(formats strfmt.Registry) error { return nil } -func (m *IdentityCreate) validateType(formats strfmt.Registry) error { +func (m *IdentityCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err } - return err } return nil @@ -330,6 +504,11 @@ 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 { diff --git a/rest_model/identity_detail.go b/rest_model/identity_detail.go index d4df5144a..31910d24a 100644 --- a/rest_model/identity_detail.go +++ b/rest_model/identity_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -50,7 +52,8 @@ type IdentityDetail struct { Authenticators *IdentityAuthenticators `json:"authenticators"` // default hosting cost - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + // Required: true + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` // default hosting precedence DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -127,7 +130,7 @@ func (m *IdentityDetail) UnmarshalJSON(raw []byte) error { Authenticators *IdentityAuthenticators `json:"authenticators"` - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -216,7 +219,7 @@ func (m IdentityDetail) MarshalJSON() ([]byte, error) { Authenticators *IdentityAuthenticators `json:"authenticators"` - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -386,11 +389,13 @@ func (m *IdentityDetail) validateAppData(formats strfmt.Registry) error { return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil @@ -416,17 +421,23 @@ func (m *IdentityDetail) validateAuthenticators(formats strfmt.Registry) error { func (m *IdentityDetail) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required - return nil + if err := validate.Required("defaultHostingCost", "body", m.DefaultHostingCost); err != nil { + return err } - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } + 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") + } + return err + } + } + return nil } @@ -572,25 +583,37 @@ func (m *IdentityDetail) validateSdkInfo(formats strfmt.Registry) error { func (m *IdentityDetail) validateServiceHostingCosts(formats strfmt.Registry) error { - if err := m.ServiceHostingCosts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } + 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") + } + return err + } + } + return nil } func (m *IdentityDetail) validateServiceHostingPrecedences(formats strfmt.Registry) error { - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } + 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") + } + return err + } + } + return nil } @@ -621,6 +644,209 @@ func (m *IdentityDetail) validateTypeID(formats strfmt.Registry) error { 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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + +func (m *IdentityDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IdentityDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/identity_enrollments.go b/rest_model/identity_enrollments.go index 5e7d6c8f6..eed85e0a5 100644 --- a/rest_model/identity_enrollments.go +++ b/rest_model/identity_enrollments.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -74,7 +76,6 @@ func (m *IdentityEnrollments) Validate(formats strfmt.Registry) error { } func (m *IdentityEnrollments) validateOtt(formats strfmt.Registry) error { - if swag.IsZero(m.Ott) { // not required return nil } @@ -92,7 +93,6 @@ func (m *IdentityEnrollments) validateOtt(formats strfmt.Registry) error { } func (m *IdentityEnrollments) validateOttca(formats strfmt.Registry) error { - if swag.IsZero(m.Ottca) { // not required return nil } @@ -110,7 +110,6 @@ func (m *IdentityEnrollments) validateOttca(formats strfmt.Registry) error { } func (m *IdentityEnrollments) validateUpdb(formats strfmt.Registry) error { - if swag.IsZero(m.Updb) { // not required return nil } @@ -127,6 +126,70 @@ func (m *IdentityEnrollments) validateUpdb(formats strfmt.Registry) error { 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IdentityEnrollments) MarshalBinary() ([]byte, error) { if m == nil { @@ -179,7 +242,6 @@ func (m *IdentityEnrollmentsOtt) Validate(formats strfmt.Registry) error { } func (m *IdentityEnrollmentsOtt) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required return nil } @@ -191,6 +253,11 @@ func (m *IdentityEnrollmentsOtt) validateExpiresAt(formats strfmt.Registry) erro 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 { @@ -253,7 +320,6 @@ func (m *IdentityEnrollmentsOttca) Validate(formats strfmt.Registry) error { } func (m *IdentityEnrollmentsOttca) validateCa(formats strfmt.Registry) error { - if swag.IsZero(m.Ca) { // not required return nil } @@ -271,7 +337,6 @@ func (m *IdentityEnrollmentsOttca) validateCa(formats strfmt.Registry) error { } func (m *IdentityEnrollmentsOttca) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required return nil } @@ -283,6 +348,34 @@ func (m *IdentityEnrollmentsOttca) validateExpiresAt(formats strfmt.Registry) er 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IdentityEnrollmentsOttca) MarshalBinary() ([]byte, error) { if m == nil { @@ -335,7 +428,6 @@ func (m *IdentityEnrollmentsUpdb) Validate(formats strfmt.Registry) error { } func (m *IdentityEnrollmentsUpdb) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required return nil } @@ -347,6 +439,11 @@ func (m *IdentityEnrollmentsUpdb) validateExpiresAt(formats strfmt.Registry) 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 { diff --git a/rest_model/identity_list.go b/rest_model/identity_list.go index 50ac55d53..a9e26dabf 100644 --- a/rest_model/identity_list.go +++ b/rest_model/identity_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m IdentityList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index d79e404b9..82257da5d 100644 --- a/rest_model/identity_patch.go +++ b/rest_model/identity_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -44,7 +46,7 @@ type IdentityPatch struct { AppData Tags `json:"appData"` // default hosting cost - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` // default hosting precedence DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -114,39 +116,40 @@ func (m *IdentityPatch) Validate(formats strfmt.Registry) error { } func (m *IdentityPatch) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil } func (m *IdentityPatch) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required return nil } - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") + if m.DefaultHostingCost != nil { + if err := m.DefaultHostingCost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("defaultHostingCost") + } + return err } - return err } return nil } func (m *IdentityPatch) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required return nil } @@ -162,7 +165,6 @@ func (m *IdentityPatch) validateDefaultHostingPrecedence(formats strfmt.Registry } func (m *IdentityPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -178,12 +180,166 @@ func (m *IdentityPatch) validateRoleAttributes(formats strfmt.Registry) error { } func (m *IdentityPatch) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required return nil } - if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if m.ServiceHostingCosts != nil { + if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *IdentityPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") } @@ -193,13 +349,9 @@ func (m *IdentityPatch) validateServiceHostingCosts(formats strfmt.Registry) err return nil } -func (m *IdentityPatch) validateServiceHostingPrecedences(formats strfmt.Registry) error { +func (m *IdentityPatch) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { + if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("serviceHostingPrecedences") } @@ -209,13 +361,9 @@ func (m *IdentityPatch) validateServiceHostingPrecedences(formats strfmt.Registr return nil } -func (m *IdentityPatch) validateTags(formats strfmt.Registry) error { +func (m *IdentityPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if err := m.Tags.Validate(formats); err != nil { + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -225,13 +373,9 @@ func (m *IdentityPatch) validateTags(formats strfmt.Registry) error { return nil } -func (m *IdentityPatch) validateType(formats strfmt.Registry) error { +func (m *IdentityPatch) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") } diff --git a/rest_model/identity_type.go b/rest_model/identity_type.go index bb277fb58..b61999dc3 100644 --- a/rest_model/identity_type.go +++ b/rest_model/identity_type.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model identityType type IdentityType string +func NewIdentityType(value IdentityType) *IdentityType { + v := value + return &v +} + const ( // IdentityTypeUser captures enum value "User" @@ -91,3 +97,8 @@ func (m IdentityType) Validate(formats strfmt.Registry) error { } 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 index 5835ff35a..ddaa731f2 100644 --- a/rest_model/identity_type_detail.go +++ b/rest_model/identity_type_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -105,6 +107,21 @@ func (m *IdentityTypeDetail) Validate(formats strfmt.Registry) error { 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 { diff --git a/rest_model/identity_type_list.go b/rest_model/identity_type_list.go index 8e9f629cf..5af338c15 100644 --- a/rest_model/identity_type_list.go +++ b/rest_model/identity_type_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,7 @@ import ( // IdentityTypeList identity type list // // swagger:model identityTypeList -type IdentityTypeList []*IdentityDetail +type IdentityTypeList []*IdentityTypeDetail // Validate validates this identity type list func (m IdentityTypeList) Validate(formats strfmt.Registry) error { @@ -67,3 +68,26 @@ func (m IdentityTypeList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index c6305dbe0..f02d6deb5 100644 --- a/rest_model/identity_update.go +++ b/rest_model/identity_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -45,7 +47,7 @@ type IdentityUpdate struct { AppData Tags `json:"appData"` // default hosting cost - DefaultHostingCost TerminatorCost `json:"defaultHostingCost,omitempty"` + DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` // default hosting precedence DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` @@ -72,7 +74,7 @@ type IdentityUpdate struct { // type // Required: true - Type IdentityType `json:"type"` + Type *IdentityType `json:"type"` } // Validate validates this identity update @@ -126,39 +128,40 @@ func (m *IdentityUpdate) Validate(formats strfmt.Registry) error { } func (m *IdentityUpdate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required return nil } - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") + if m.AppData != nil { + if err := m.AppData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appData") + } + return err } - return err } return nil } func (m *IdentityUpdate) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required return nil } - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") + if m.DefaultHostingCost != nil { + if err := m.DefaultHostingCost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("defaultHostingCost") + } + return err } - return err } return nil } func (m *IdentityUpdate) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required return nil } @@ -192,7 +195,6 @@ func (m *IdentityUpdate) validateName(formats strfmt.Registry) error { } func (m *IdentityUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required return nil } @@ -208,12 +210,173 @@ func (m *IdentityUpdate) validateRoleAttributes(formats strfmt.Registry) error { } func (m *IdentityUpdate) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required return nil } - if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if m.ServiceHostingCosts != nil { + if err := m.ServiceHostingCosts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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 err := m.AppData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *IdentityUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") } @@ -223,13 +386,9 @@ func (m *IdentityUpdate) validateServiceHostingCosts(formats strfmt.Registry) er return nil } -func (m *IdentityUpdate) validateServiceHostingPrecedences(formats strfmt.Registry) error { +func (m *IdentityUpdate) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { + if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("serviceHostingPrecedences") } @@ -239,13 +398,9 @@ func (m *IdentityUpdate) validateServiceHostingPrecedences(formats strfmt.Regist return nil } -func (m *IdentityUpdate) validateTags(formats strfmt.Registry) error { +func (m *IdentityUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if err := m.Tags.Validate(formats); err != nil { + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -255,13 +410,15 @@ func (m *IdentityUpdate) validateTags(formats strfmt.Registry) error { return nil } -func (m *IdentityUpdate) validateType(formats strfmt.Registry) error { +func (m *IdentityUpdate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err } - return err } return nil diff --git a/rest_model/link.go b/rest_model/link.go index 877bf2563..582ad60a1 100644 --- a/rest_model/link.go +++ b/rest_model/link.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -80,6 +82,11 @@ func (m *Link) validateHref(formats strfmt.Registry) error { 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 { diff --git a/rest_model/links.go b/rest_model/links.go index 77e0fb7b5..84a6d2251 100644 --- a/rest_model/links.go +++ b/rest_model/links.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,3 +64,23 @@ func (m Links) Validate(formats strfmt.Registry) error { } 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 index 487972a04..f5d5edead 100644 --- a/rest_model/list_api_sessions_envelope.go +++ b/rest_model/list_api_sessions_envelope.go @@ -30,15 +30,17 @@ package rest_model // 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 +// ListAPISessionsEnvelope list Api sessions envelope // -// swagger:model listAPISessionsEnvelope +// swagger:model listApiSessionsEnvelope type ListAPISessionsEnvelope struct { // data @@ -50,7 +52,7 @@ type ListAPISessionsEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this list API sessions envelope +// Validate validates this list Api sessions envelope func (m *ListAPISessionsEnvelope) Validate(formats strfmt.Registry) error { var res []error @@ -102,6 +104,50 @@ func (m *ListAPISessionsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListAPISessionsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_authenticators_envelope.go b/rest_model/list_authenticators_envelope.go index 1f05bba06..4b1ae962d 100644 --- a/rest_model/list_authenticators_envelope.go +++ b/rest_model/list_authenticators_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -66,7 +68,6 @@ func (m *ListAuthenticatorsEnvelope) Validate(formats strfmt.Registry) error { } func (m *ListAuthenticatorsEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -82,7 +83,6 @@ func (m *ListAuthenticatorsEnvelope) validateData(formats strfmt.Registry) error } func (m *ListAuthenticatorsEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required return nil } @@ -99,6 +99,50 @@ func (m *ListAuthenticatorsEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListAuthenticatorsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_cas_envelope.go b/rest_model/list_cas_envelope.go index d201b773a..57a84d297 100644 --- a/rest_model/list_cas_envelope.go +++ b/rest_model/list_cas_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListCasEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListCasEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_geo_regions_envelope.go b/rest_model/list_client_terminators_envelope.go similarity index 57% rename from rest_model/list_geo_regions_envelope.go rename to rest_model/list_client_terminators_envelope.go index 3680918f6..e7c5f26aa 100644 --- a/rest_model/list_geo_regions_envelope.go +++ b/rest_model/list_client_terminators_envelope.go @@ -30,28 +30,30 @@ package rest_model // 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" ) -// ListGeoRegionsEnvelope list geo regions envelope +// ListClientTerminatorsEnvelope list client terminators envelope // -// swagger:model listGeoRegionsEnvelope -type ListGeoRegionsEnvelope struct { +// swagger:model listClientTerminatorsEnvelope +type ListClientTerminatorsEnvelope struct { // data // Required: true - Data GeoRegionList `json:"data"` + Data TerminatorClientList `json:"data"` // meta // Required: true Meta *Meta `json:"meta"` } -// Validate validates this list geo regions envelope -func (m *ListGeoRegionsEnvelope) Validate(formats strfmt.Registry) error { +// 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 { @@ -68,7 +70,7 @@ func (m *ListGeoRegionsEnvelope) Validate(formats strfmt.Registry) error { return nil } -func (m *ListGeoRegionsEnvelope) validateData(formats strfmt.Registry) error { +func (m *ListClientTerminatorsEnvelope) validateData(formats strfmt.Registry) error { if err := validate.Required("data", "body", m.Data); err != nil { return err @@ -84,7 +86,7 @@ func (m *ListGeoRegionsEnvelope) validateData(formats strfmt.Registry) error { return nil } -func (m *ListGeoRegionsEnvelope) validateMeta(formats strfmt.Registry) error { +func (m *ListClientTerminatorsEnvelope) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,8 +104,52 @@ func (m *ListGeoRegionsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *ListGeoRegionsEnvelope) MarshalBinary() ([]byte, error) { +func (m *ListClientTerminatorsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -111,8 +157,8 @@ func (m *ListGeoRegionsEnvelope) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ListGeoRegionsEnvelope) UnmarshalBinary(b []byte) error { - var res ListGeoRegionsEnvelope +func (m *ListClientTerminatorsEnvelope) UnmarshalBinary(b []byte) error { + var res ListClientTerminatorsEnvelope if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/list_config_types_envelope.go b/rest_model/list_config_types_envelope.go index ebab38dcc..8046cdabd 100644 --- a/rest_model/list_config_types_envelope.go +++ b/rest_model/list_config_types_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListConfigTypesEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListConfigTypesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_configs_envelope.go b/rest_model/list_configs_envelope.go index 6e758ee92..173f8e59a 100644 --- a/rest_model/list_configs_envelope.go +++ b/rest_model/list_configs_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListConfigsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListConfigsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_current_api_session_certificates_envelope.go b/rest_model/list_current_api_session_certificates_envelope.go index d94d93925..7a1bdaa51 100644 --- a/rest_model/list_current_api_session_certificates_envelope.go +++ b/rest_model/list_current_api_session_certificates_envelope.go @@ -30,15 +30,17 @@ package rest_model // 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 +// ListCurrentAPISessionCertificatesEnvelope list current Api session certificates envelope // -// swagger:model listCurrentAPISessionCertificatesEnvelope +// swagger:model listCurrentApiSessionCertificatesEnvelope type ListCurrentAPISessionCertificatesEnvelope struct { // data @@ -50,7 +52,7 @@ type ListCurrentAPISessionCertificatesEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this list current API session certificates envelope +// Validate validates this list current Api session certificates envelope func (m *ListCurrentAPISessionCertificatesEnvelope) Validate(formats strfmt.Registry) error { var res []error @@ -102,6 +104,50 @@ func (m *ListCurrentAPISessionCertificatesEnvelope) validateMeta(formats strfmt. 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListCurrentAPISessionCertificatesEnvelope) MarshalBinary() ([]byte, error) { if m == 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 index fd7fe4997..c08e11bd9 100644 --- a/rest_model/list_current_api_session_service_updates_envelope.go +++ b/rest_model/list_current_api_session_service_updates_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *ListCurrentAPISessionServiceUpdatesEnvelope) validateMeta(formats strfm 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListCurrentAPISessionServiceUpdatesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_current_identity_edge_routers_envelope.go b/rest_model/list_current_identity_edge_routers_envelope.go index b891410ce..8ad229c4f 100644 --- a/rest_model/list_current_identity_edge_routers_envelope.go +++ b/rest_model/list_current_identity_edge_routers_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListCurrentIdentityEdgeRoutersEnvelope) validateMeta(formats strfmt.Reg 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListCurrentIdentityEdgeRoutersEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_edge_router_policies_envelope.go b/rest_model/list_edge_router_policies_envelope.go index 1fc26bdcd..a6341f39c 100644 --- a/rest_model/list_edge_router_policies_envelope.go +++ b/rest_model/list_edge_router_policies_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListEdgeRouterPoliciesEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListEdgeRouterPoliciesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_edge_routers_envelope.go b/rest_model/list_edge_routers_envelope.go index 4a2d23a9c..abe7e9345 100644 --- a/rest_model/list_edge_routers_envelope.go +++ b/rest_model/list_edge_routers_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListEdgeRoutersEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListEdgeRoutersEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_enrollments_envelope.go b/rest_model/list_enrollments_envelope.go index 5abc4f029..9d9810271 100644 --- a/rest_model/list_enrollments_envelope.go +++ b/rest_model/list_enrollments_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListEnrollmentsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListEnrollmentsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_identities_envelope.go b/rest_model/list_identities_envelope.go index c20c472bc..1cc873fe4 100644 --- a/rest_model/list_identities_envelope.go +++ b/rest_model/list_identities_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListIdentitiesEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListIdentitiesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_identity_types_envelope.go b/rest_model/list_identity_types_envelope.go index 3bca6b6a7..56055af8b 100644 --- a/rest_model/list_identity_types_envelope.go +++ b/rest_model/list_identity_types_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListIdentityTypesEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListIdentityTypesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_posture_check_envelope.go b/rest_model/list_posture_check_envelope.go index dbe0c77fc..a6eaa1e9c 100644 --- a/rest_model/list_posture_check_envelope.go +++ b/rest_model/list_posture_check_envelope.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "strconv" @@ -178,6 +179,54 @@ func (m *ListPostureCheckEnvelope) validateMeta(formats strfmt.Registry) error { 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)) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListPostureCheckEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_posture_check_types_envelope.go b/rest_model/list_posture_check_types_envelope.go index e61a7398e..154577298 100644 --- a/rest_model/list_posture_check_types_envelope.go +++ b/rest_model/list_posture_check_types_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListPostureCheckTypesEnvelope) validateMeta(formats strfmt.Registry) er 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListPostureCheckTypesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_protocols.go b/rest_model/list_protocols.go index 0637c6804..f41b95bc4 100644 --- a/rest_model/list_protocols.go +++ b/rest_model/list_protocols.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,3 +64,23 @@ func (m ListProtocols) Validate(formats strfmt.Registry) error { } 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 index fea869934..c24fbf16c 100644 --- a/rest_model/list_protocols_envelope.go +++ b/rest_model/list_protocols_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -70,13 +72,19 @@ func (m *ListProtocolsEnvelope) Validate(formats strfmt.Registry) error { func (m *ListProtocolsEnvelope) validateData(formats strfmt.Registry) error { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } + 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") + } + return err + } + } + return nil } @@ -98,6 +106,50 @@ func (m *ListProtocolsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListProtocolsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_role_attributes_envelope.go b/rest_model/list_role_attributes_envelope.go index 18ac1866e..f92a3dc27 100644 --- a/rest_model/list_role_attributes_envelope.go +++ b/rest_model/list_role_attributes_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListRoleAttributesEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListRoleAttributesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_transit_routers_envelope.go b/rest_model/list_routers_envelope.go similarity index 59% rename from rest_model/list_transit_routers_envelope.go rename to rest_model/list_routers_envelope.go index 3673a5d8a..c34628032 100644 --- a/rest_model/list_transit_routers_envelope.go +++ b/rest_model/list_routers_envelope.go @@ -30,28 +30,30 @@ package rest_model // 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" ) -// ListTransitRoutersEnvelope list transit routers envelope +// ListRoutersEnvelope list routers envelope // -// swagger:model listTransitRoutersEnvelope -type ListTransitRoutersEnvelope struct { +// swagger:model listRoutersEnvelope +type ListRoutersEnvelope struct { // data // Required: true - Data TransitRouterList `json:"data"` + Data RouterList `json:"data"` // meta // Required: true Meta *Meta `json:"meta"` } -// Validate validates this list transit routers envelope -func (m *ListTransitRoutersEnvelope) Validate(formats strfmt.Registry) error { +// Validate validates this list routers envelope +func (m *ListRoutersEnvelope) Validate(formats strfmt.Registry) error { var res []error if err := m.validateData(formats); err != nil { @@ -68,7 +70,7 @@ func (m *ListTransitRoutersEnvelope) Validate(formats strfmt.Registry) error { return nil } -func (m *ListTransitRoutersEnvelope) validateData(formats strfmt.Registry) error { +func (m *ListRoutersEnvelope) validateData(formats strfmt.Registry) error { if err := validate.Required("data", "body", m.Data); err != nil { return err @@ -84,7 +86,7 @@ func (m *ListTransitRoutersEnvelope) validateData(formats strfmt.Registry) error return nil } -func (m *ListTransitRoutersEnvelope) validateMeta(formats strfmt.Registry) error { +func (m *ListRoutersEnvelope) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,8 +104,52 @@ func (m *ListTransitRoutersEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *ListTransitRoutersEnvelope) MarshalBinary() ([]byte, error) { +func (m *ListRoutersEnvelope) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -111,8 +157,8 @@ func (m *ListTransitRoutersEnvelope) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ListTransitRoutersEnvelope) UnmarshalBinary(b []byte) error { - var res ListTransitRoutersEnvelope +func (m *ListRoutersEnvelope) UnmarshalBinary(b []byte) error { + var res ListRoutersEnvelope if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/list_service_configs_envelope.go b/rest_model/list_service_configs_envelope.go index c8c7300ea..4990e9864 100644 --- a/rest_model/list_service_configs_envelope.go +++ b/rest_model/list_service_configs_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListServiceConfigsEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListServiceConfigsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_service_edge_router_policies_envelope.go b/rest_model/list_service_edge_router_policies_envelope.go index 31234b660..584cf0f6b 100644 --- a/rest_model/list_service_edge_router_policies_envelope.go +++ b/rest_model/list_service_edge_router_policies_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListServiceEdgeRouterPoliciesEnvelope) validateMeta(formats strfmt.Regi 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListServiceEdgeRouterPoliciesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_service_policies_envelope.go b/rest_model/list_service_policies_envelope.go index 52fc55774..9772908c3 100644 --- a/rest_model/list_service_policies_envelope.go +++ b/rest_model/list_service_policies_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListServicePoliciesEnvelope) validateMeta(formats strfmt.Registry) erro 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListServicePoliciesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_services_envelope.go b/rest_model/list_services_envelope.go index 5c13c9a97..6c44e83a7 100644 --- a/rest_model/list_services_envelope.go +++ b/rest_model/list_services_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListServicesEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListServicesEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_sessions_envelope.go b/rest_model/list_sessions_envelope.go index 31c4b5426..0d31750cc 100644 --- a/rest_model/list_sessions_envelope.go +++ b/rest_model/list_sessions_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListSessionsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListSessionsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_specs_envelope.go b/rest_model/list_specs_envelope.go index 4b4cb967b..c44de17f9 100644 --- a/rest_model/list_specs_envelope.go +++ b/rest_model/list_specs_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListSpecsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListSpecsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_summary_counts.go b/rest_model/list_summary_counts.go index e5fc15c70..fe752e3a0 100644 --- a/rest_model/list_summary_counts.go +++ b/rest_model/list_summary_counts.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type ListSummaryCounts map[string]int64 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 index 3cf655a3f..333e16bd0 100644 --- a/rest_model/list_summary_counts_envelope.go +++ b/rest_model/list_summary_counts_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -70,13 +72,19 @@ func (m *ListSummaryCountsEnvelope) Validate(formats strfmt.Registry) error { func (m *ListSummaryCountsEnvelope) validateData(formats strfmt.Registry) error { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } + 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") + } + return err + } + } + return nil } @@ -98,6 +106,50 @@ func (m *ListSummaryCountsEnvelope) validateMeta(formats strfmt.Registry) error 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListSummaryCountsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_terminators_envelope.go b/rest_model/list_terminators_envelope.go index 22922bcf9..5685df5b4 100644 --- a/rest_model/list_terminators_envelope.go +++ b/rest_model/list_terminators_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -102,6 +104,50 @@ func (m *ListTerminatorsEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListTerminatorsEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/list_version_envelope.go b/rest_model/list_version_envelope.go index d28cc92ab..aae07d445 100644 --- a/rest_model/list_version_envelope.go +++ b/rest_model/list_version_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -104,6 +106,52 @@ func (m *ListVersionEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ListVersionEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/meta.go b/rest_model/meta.go index 3fbd6d3ed..674ab4dac 100644 --- a/rest_model/meta.go +++ b/rest_model/meta.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -68,7 +70,6 @@ func (m *Meta) Validate(formats strfmt.Registry) error { } func (m *Meta) validatePagination(formats strfmt.Registry) error { - if swag.IsZero(m.Pagination) { // not required return nil } @@ -85,6 +86,34 @@ func (m *Meta) validatePagination(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Meta) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/mfa_code.go b/rest_model/mfa_code.go index 4b38381a6..f3a59d388 100644 --- a/rest_model/mfa_code.go +++ b/rest_model/mfa_code.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -69,6 +71,11 @@ func (m *MfaCode) validateCode(formats strfmt.Registry) error { 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 { diff --git a/rest_model/mfa_created_envelope.go b/rest_model/mfa_created_envelope.go deleted file mode 100644 index 00dc93323..000000000 --- a/rest_model/mfa_created_envelope.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 rest_model - -// 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/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MfaCreatedEnvelope mfa created envelope -// -// swagger:model mfaCreatedEnvelope -type MfaCreatedEnvelope struct { - - // error - // Required: true - Error *APIError `json:"error"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this mfa created envelope -func (m *MfaCreatedEnvelope) 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 *MfaCreatedEnvelope) 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") - } - return err - } - } - - return nil -} - -func (m *MfaCreatedEnvelope) 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") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MfaCreatedEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MfaCreatedEnvelope) UnmarshalBinary(b []byte) error { - var res MfaCreatedEnvelope - 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 index 888230e7b..eb43a6f82 100644 --- a/rest_model/mfa_formats.go +++ b/rest_model/mfa_formats.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model mfaFormats type MfaFormats string +func NewMfaFormats(value MfaFormats) *MfaFormats { + v := value + return &v +} + const ( // MfaFormatsNumeric captures enum value "numeric" @@ -88,3 +94,8 @@ func (m MfaFormats) Validate(formats strfmt.Registry) error { } 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 index 79ca818b1..8b97d0ceb 100644 --- a/rest_model/mfa_providers.go +++ b/rest_model/mfa_providers.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model mfaProviders type MfaProviders string +func NewMfaProviders(value MfaProviders) *MfaProviders { + v := value + return &v +} + const ( // MfaProvidersZiti captures enum value "ziti" @@ -82,3 +88,8 @@ func (m MfaProviders) Validate(formats strfmt.Registry) error { } 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 index 8f96e806b..b4b18a7f5 100644 --- a/rest_model/named_role.go +++ b/rest_model/named_role.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -51,6 +53,11 @@ 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 { diff --git a/rest_model/named_roles.go b/rest_model/named_roles.go index 78373f3c4..a38369ce0 100644 --- a/rest_model/named_roles.go +++ b/rest_model/named_roles.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m NamedRoles) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 9b4b0c70c..41c7b0c0e 100644 --- a/rest_model/operating_system.go +++ b/rest_model/operating_system.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -43,7 +45,7 @@ type OperatingSystem struct { // type // Required: true - Type OsType `json:"type"` + Type *OsType `json:"type"` // versions // Required: true @@ -70,13 +72,23 @@ func (m *OperatingSystem) Validate(formats strfmt.Registry) error { func (m *OperatingSystem) validateType(formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } + 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") + } + return err + } + } + return nil } @@ -89,6 +101,34 @@ func (m *OperatingSystem) validateVersions(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *OperatingSystem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/os_type.go b/rest_model/os_type.go index 6ad280ba8..f633e1c7a 100644 --- a/rest_model/os_type.go +++ b/rest_model/os_type.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model osType type OsType string +func NewOsType(value OsType) *OsType { + v := value + return &v +} + const ( // OsTypeWindows captures enum value "Windows" @@ -97,3 +103,8 @@ func (m OsType) Validate(formats strfmt.Registry) error { } 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 index a37835d65..3941fd45b 100644 --- a/rest_model/pagination.go +++ b/rest_model/pagination.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -103,6 +105,11 @@ func (m *Pagination) validateTotalCount(formats strfmt.Registry) error { 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 { diff --git a/rest_model/password.go b/rest_model/password.go index 9b7351f75..0e97ab7ff 100644 --- a/rest_model/password.go +++ b/rest_model/password.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -57,3 +59,8 @@ func (m Password) Validate(formats strfmt.Registry) error { } 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 index 650705d4d..fcfe8bc36 100644 --- a/rest_model/password_nullable.go +++ b/rest_model/password_nullable.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,7 +39,7 @@ import ( // PasswordNullable password nullable // -// swagger:model password-nullable +// swagger:model passwordNullable type PasswordNullable string // Validate validates this password nullable @@ -57,3 +59,8 @@ func (m PasswordNullable) Validate(formats strfmt.Registry) error { } 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 index 95f30f8cb..990f09108 100644 --- a/rest_model/policy_advice.go +++ b/rest_model/policy_advice.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -93,7 +94,6 @@ func (m *PolicyAdvice) Validate(formats strfmt.Registry) error { } func (m *PolicyAdvice) validateCommonRouters(formats strfmt.Registry) error { - if swag.IsZero(m.CommonRouters) { // not required return nil } @@ -118,7 +118,6 @@ func (m *PolicyAdvice) validateCommonRouters(formats strfmt.Registry) error { } func (m *PolicyAdvice) validateIdentity(formats strfmt.Registry) error { - if swag.IsZero(m.Identity) { // not required return nil } @@ -136,7 +135,6 @@ func (m *PolicyAdvice) validateIdentity(formats strfmt.Registry) error { } func (m *PolicyAdvice) validateService(formats strfmt.Registry) error { - if swag.IsZero(m.Service) { // not required return nil } @@ -153,6 +151,74 @@ func (m *PolicyAdvice) validateService(formats strfmt.Registry) error { 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)) + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PolicyAdvice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/policy_failure.go b/rest_model/policy_failure.go index 91aca64f6..b4bc83da3 100644 --- a/rest_model/policy_failure.go +++ b/rest_model/policy_failure.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "strconv" @@ -151,7 +152,6 @@ func (m *PolicyFailure) Validate(formats strfmt.Registry) error { } func (m *PolicyFailure) validateChecks(formats strfmt.Registry) error { - if swag.IsZero(m.Checks()) { // not required return nil } @@ -170,6 +170,36 @@ func (m *PolicyFailure) validateChecks(formats strfmt.Registry) error { 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)) + } + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PolicyFailure) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_create.go b/rest_model/posture_check_create.go index a9f1fddf8..f5a974e4a 100644 --- a/rest_model/posture_check_create.go +++ b/rest_model/posture_check_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -44,9 +45,10 @@ import ( // PostureCheckCreate posture check create // -// swagger:discriminator PostureCheckCreate typeId +// swagger:discriminator postureCheckCreate typeId type PostureCheckCreate interface { runtime.Validatable + runtime.ContextValidatable // name // Required: true @@ -112,7 +114,7 @@ func (m *postureCheckCreate) SetTags(val Tags) { // TypeID gets the type Id of this polymorphic type func (m *postureCheckCreate) TypeID() PostureCheckType { - return "PostureCheckCreate" + return "postureCheckCreate" } // SetTypeID sets the type Id of this polymorphic type @@ -201,7 +203,7 @@ func unmarshalPostureCheckCreate(data []byte, consumer runtime.Consumer) (Postur return nil, err } return &result, nil - case "PostureCheckCreate": + case "postureCheckCreate": var result postureCheckCreate if err := consumer.Consume(buf2, &result); err != nil { return nil, err @@ -243,7 +245,6 @@ func (m *postureCheckCreate) validateName(formats strfmt.Registry) error { } func (m *postureCheckCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required return nil } @@ -259,12 +260,59 @@ func (m *postureCheckCreate) validateRoleAttributes(formats strfmt.Registry) err } func (m *postureCheckCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *postureCheckCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -273,3 +321,15 @@ func (m *postureCheckCreate) validateTags(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} diff --git a/rest_model/posture_check_detail.go b/rest_model/posture_check_detail.go index 76ace6922..02b360cbf 100644 --- a/rest_model/posture_check_detail.go +++ b/rest_model/posture_check_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -43,9 +44,10 @@ import ( // PostureCheckDetail posture check detail // -// swagger:discriminator PostureCheckDetail typeId +// swagger:discriminator postureCheckDetail typeId type PostureCheckDetail interface { runtime.Validatable + runtime.ContextValidatable // links // Required: true @@ -180,7 +182,7 @@ func (m *postureCheckDetail) SetTags(val Tags) { // TypeID gets the type Id of this polymorphic type func (m *postureCheckDetail) TypeID() string { - return "PostureCheckDetail" + return "postureCheckDetail" } // SetTypeID sets the type Id of this polymorphic type @@ -289,7 +291,7 @@ func unmarshalPostureCheckDetail(data []byte, consumer runtime.Consumer) (Postur return nil, err } return &result, nil - case "PostureCheckDetail": + case "postureCheckDetail": var result postureCheckDetail if err := consumer.Consume(buf2, &result); err != nil { return nil, err @@ -343,13 +345,19 @@ func (m *postureCheckDetail) Validate(formats strfmt.Registry) error { func (m *postureCheckDetail) validateLinks(formats strfmt.Registry) error { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } + 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") + } + return err + } + } + return nil } @@ -402,13 +410,19 @@ func (m *postureCheckDetail) validateRoleAttributes(formats strfmt.Registry) err func (m *postureCheckDetail) validateTags(formats strfmt.Registry) error { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } + 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") + } + return err + } + } + return nil } @@ -433,3 +447,61 @@ func (m *postureCheckDetail) validateVersion(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} + +func (m *postureCheckDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *postureCheckDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} diff --git a/rest_model/posture_check_domain_create.go b/rest_model/posture_check_domain_create.go index 7a995f1c3..69b62c668 100644 --- a/rest_model/posture_check_domain_create.go +++ b/rest_model/posture_check_domain_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckDomainCreate posture check domain create // -// swagger:model PostureCheckDomainCreate +// swagger:model postureCheckDomainCreate type PostureCheckDomainCreate struct { nameField *string @@ -249,11 +250,13 @@ func (m *PostureCheckDomainCreate) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,60 @@ func (m *PostureCheckDomainCreate) validateDomains(formats strfmt.Registry) erro 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckDomainCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckDomainCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_domain_detail.go b/rest_model/posture_check_domain_detail.go index 9db8e54db..0e5ea8b03 100644 --- a/rest_model/posture_check_domain_detail.go +++ b/rest_model/posture_check_domain_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckDomainDetail posture check domain detail // -// swagger:model PostureCheckDomainDetail +// swagger:model postureCheckDomainDetail type PostureCheckDomainDetail struct { linksField Links @@ -343,11 +344,13 @@ func (m *PostureCheckDomainDetail) validateLinks(formats strfmt.Registry) error return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -406,11 +409,13 @@ func (m *PostureCheckDomainDetail) validateTags(formats strfmt.Registry) error { return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -453,6 +458,64 @@ func (m *PostureCheckDomainDetail) validateDomains(formats strfmt.Registry) erro 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") + } + return err + } + + return nil +} + +func (m *PostureCheckDomainDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckDomainDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckDomainDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_domain_patch.go b/rest_model/posture_check_domain_patch.go index be96f0583..8d3c992c3 100644 --- a/rest_model/posture_check_domain_patch.go +++ b/rest_model/posture_check_domain_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckDomainPatch posture check domain patch // -// swagger:model PostureCheckDomainPatch +// swagger:model postureCheckDomainPatch type PostureCheckDomainPatch struct { nameField string @@ -213,11 +214,13 @@ func (m *PostureCheckDomainPatch) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -238,6 +241,48 @@ func (m *PostureCheckDomainPatch) validateDomains(formats strfmt.Registry) error 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckDomainPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckDomainPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_domain_update.go b/rest_model/posture_check_domain_update.go index 8e101892a..1717c8600 100644 --- a/rest_model/posture_check_domain_update.go +++ b/rest_model/posture_check_domain_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckDomainUpdate posture check domain update // -// swagger:model PostureCheckDomainUpdate +// swagger:model postureCheckDomainUpdate type PostureCheckDomainUpdate struct { nameField *string @@ -249,11 +250,13 @@ func (m *PostureCheckDomainUpdate) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,60 @@ func (m *PostureCheckDomainUpdate) validateDomains(formats strfmt.Registry) erro 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckDomainUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckDomainUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_failure.go b/rest_model/posture_check_failure.go index c7a4cf661..e96f6ff29 100644 --- a/rest_model/posture_check_failure.go +++ b/rest_model/posture_check_failure.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -46,6 +47,7 @@ import ( // swagger:discriminator postureCheckFailure postureCheckType type PostureCheckFailure interface { runtime.Validatable + runtime.ContextValidatable // posture check Id // Required: true @@ -230,3 +232,8 @@ func (m *postureCheckFailure) validatePostureCheckName(formats strfmt.Registry) 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 index 53045a327..bc8dbab71 100644 --- a/rest_model/posture_check_failure_domain.go +++ b/rest_model/posture_check_failure_domain.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -246,6 +247,16 @@ func (m *PostureCheckFailureDomain) validateExpectedValue(formats strfmt.Registr 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 { diff --git a/rest_model/posture_check_failure_mac_address.go b/rest_model/posture_check_failure_mac_address.go index fac5c43c6..0b51de9ae 100644 --- a/rest_model/posture_check_failure_mac_address.go +++ b/rest_model/posture_check_failure_mac_address.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -246,6 +247,16 @@ func (m *PostureCheckFailureMacAddress) validateExpectedValue(formats strfmt.Reg 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 { diff --git a/rest_model/posture_check_failure_mfa.go b/rest_model/posture_check_failure_mfa.go index 17c80d332..942127356 100644 --- a/rest_model/posture_check_failure_mfa.go +++ b/rest_model/posture_check_failure_mfa.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -246,6 +247,16 @@ func (m *PostureCheckFailureMfa) validateExpectedValue(formats strfmt.Registry) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckFailureMfa) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_failure_operating_system.go b/rest_model/posture_check_failure_operating_system.go index ab3de1726..09c95948c 100644 --- a/rest_model/posture_check_failure_operating_system.go +++ b/rest_model/posture_check_failure_operating_system.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -281,6 +282,56 @@ func (m *PostureCheckFailureOperatingSystem) validateExpectedValue(formats strfm 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") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckFailureOperatingSystem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_failure_operating_system_actual.go b/rest_model/posture_check_failure_operating_system_actual.go index 11a6830db..0a8519883 100644 --- a/rest_model/posture_check_failure_operating_system_actual.go +++ b/rest_model/posture_check_failure_operating_system_actual.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -86,6 +88,11 @@ func (m *PostureCheckFailureOperatingSystemActual) validateVersion(formats strfm 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 { diff --git a/rest_model/posture_check_failure_process.go b/rest_model/posture_check_failure_process.go index 73eccaa32..1d744a56c 100644 --- a/rest_model/posture_check_failure_process.go +++ b/rest_model/posture_check_failure_process.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -264,6 +265,52 @@ func (m *PostureCheckFailureProcess) validateExpectedValue(formats strfmt.Regist 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckFailureProcess) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_failure_process_actual.go b/rest_model/posture_check_failure_process_actual.go index d7afe722e..dd064dc8a 100644 --- a/rest_model/posture_check_failure_process_actual.go +++ b/rest_model/posture_check_failure_process_actual.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -105,7 +107,6 @@ func (m *PostureCheckFailureProcessActual) validateIsRunning(formats strfmt.Regi } func (m *PostureCheckFailureProcessActual) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required return nil } @@ -129,6 +130,32 @@ func (m *PostureCheckFailureProcessActual) validateSignerFingerprints(formats st 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckFailureProcessActual) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_failure_process_multi.go b/rest_model/posture_check_failure_process_multi.go index f8ab8c9eb..7ca98eece 100644 --- a/rest_model/posture_check_failure_process_multi.go +++ b/rest_model/posture_check_failure_process_multi.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -58,7 +59,7 @@ type PostureCheckFailureProcessMulti struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } // PostureCheckID gets the posture check Id of this subtype @@ -104,7 +105,7 @@ func (m *PostureCheckFailureProcessMulti) UnmarshalJSON(raw []byte) error { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } buf := bytes.NewBuffer(raw) dec := json.NewDecoder(buf) @@ -167,7 +168,7 @@ func (m PostureCheckFailureProcessMulti) MarshalJSON() ([]byte, error) { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` }{ ActualValue: m.ActualValue, @@ -300,13 +301,95 @@ func (m *PostureCheckFailureProcessMulti) validateExpectedValue(formats strfmt.R func (m *PostureCheckFailureProcessMulti) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } + 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") + } + 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)) + } + 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)) + } + 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") + } + return err + } + } + return nil } diff --git a/rest_model/posture_check_mac_address_create.go b/rest_model/posture_check_mac_address_create.go index 8e8f99747..ae383e69f 100644 --- a/rest_model/posture_check_mac_address_create.go +++ b/rest_model/posture_check_mac_address_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMacAddressCreate posture check mac address create // -// swagger:model PostureCheckMacAddressCreate +// swagger:model postureCheckMacAddressCreate type PostureCheckMacAddressCreate struct { nameField *string @@ -249,11 +250,13 @@ func (m *PostureCheckMacAddressCreate) validateTags(formats strfmt.Registry) err return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,60 @@ func (m *PostureCheckMacAddressCreate) validateMacAddresses(formats strfmt.Regis 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMacAddressCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMacAddressCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mac_address_detail.go b/rest_model/posture_check_mac_address_detail.go index 571a5b855..1a3b85432 100644 --- a/rest_model/posture_check_mac_address_detail.go +++ b/rest_model/posture_check_mac_address_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMacAddressDetail posture check mac address detail // -// swagger:model PostureCheckMacAddressDetail +// swagger:model postureCheckMacAddressDetail type PostureCheckMacAddressDetail struct { linksField Links @@ -343,11 +344,13 @@ func (m *PostureCheckMacAddressDetail) validateLinks(formats strfmt.Registry) er return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -406,11 +409,13 @@ func (m *PostureCheckMacAddressDetail) validateTags(formats strfmt.Registry) err return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -453,6 +458,64 @@ func (m *PostureCheckMacAddressDetail) validateMacAddresses(formats strfmt.Regis 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") + } + return err + } + + return nil +} + +func (m *PostureCheckMacAddressDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMacAddressDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMacAddressDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mac_address_patch.go b/rest_model/posture_check_mac_address_patch.go index 1ff143316..2b8c8e9c9 100644 --- a/rest_model/posture_check_mac_address_patch.go +++ b/rest_model/posture_check_mac_address_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMacAddressPatch posture check mac address patch // -// swagger:model PostureCheckMacAddressPatch +// swagger:model postureCheckMacAddressPatch type PostureCheckMacAddressPatch struct { nameField string @@ -213,11 +214,13 @@ func (m *PostureCheckMacAddressPatch) validateTags(formats strfmt.Registry) erro return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -238,6 +241,48 @@ func (m *PostureCheckMacAddressPatch) validateMacAddresses(formats strfmt.Regist 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMacAddressPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMacAddressPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mac_address_update.go b/rest_model/posture_check_mac_address_update.go index 48c0a6241..92447185e 100644 --- a/rest_model/posture_check_mac_address_update.go +++ b/rest_model/posture_check_mac_address_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMacAddressUpdate posture check mac address update // -// swagger:model PostureCheckMacAddressUpdate +// swagger:model postureCheckMacAddressUpdate type PostureCheckMacAddressUpdate struct { nameField *string @@ -249,11 +250,13 @@ func (m *PostureCheckMacAddressUpdate) validateTags(formats strfmt.Registry) err return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,60 @@ func (m *PostureCheckMacAddressUpdate) validateMacAddresses(formats strfmt.Regis 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMacAddressUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMacAddressUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mfa_create.go b/rest_model/posture_check_mfa_create.go index 39d2e8002..ec147cbbd 100644 --- a/rest_model/posture_check_mfa_create.go +++ b/rest_model/posture_check_mfa_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMfaCreate posture check mfa create // -// swagger:model PostureCheckMfaCreate +// swagger:model postureCheckMfaCreate type PostureCheckMfaCreate struct { nameField *string @@ -225,7 +226,51 @@ func (m *PostureCheckMfaCreate) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostureCheckMfaCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMfaCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -235,6 +280,18 @@ func (m *PostureCheckMfaCreate) validateTags(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMfaCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mfa_detail.go b/rest_model/posture_check_mfa_detail.go index cbfded766..342b49b93 100644 --- a/rest_model/posture_check_mfa_detail.go +++ b/rest_model/posture_check_mfa_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMfaDetail posture check mfa detail // -// swagger:model PostureCheckMfaDetail +// swagger:model postureCheckMfaDetail type PostureCheckMfaDetail struct { linksField Links @@ -319,11 +320,13 @@ func (m *PostureCheckMfaDetail) validateLinks(formats strfmt.Registry) error { return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -382,11 +385,13 @@ func (m *PostureCheckMfaDetail) validateTags(formats strfmt.Registry) error { return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -414,6 +419,64 @@ func (m *PostureCheckMfaDetail) validateVersion(formats strfmt.Registry) error { 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) + } + + 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") + } + return err + } + + return nil +} + +func (m *PostureCheckMfaDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMfaDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMfaDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_mfa_patch.go b/rest_model/posture_check_mfa_patch.go index be24116a5..b6cc75849 100644 --- a/rest_model/posture_check_mfa_patch.go +++ b/rest_model/posture_check_mfa_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -40,7 +41,7 @@ import ( // PostureCheckMfaPatch posture check mfa patch // -// swagger:model PostureCheckMfaPatch +// swagger:model postureCheckMfaPatch type PostureCheckMfaPatch struct { nameField string @@ -191,7 +192,51 @@ func (m *PostureCheckMfaPatch) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostureCheckMfaPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMfaPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/posture_check_mfa_update.go b/rest_model/posture_check_mfa_update.go index f19347857..42cdd8957 100644 --- a/rest_model/posture_check_mfa_update.go +++ b/rest_model/posture_check_mfa_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckMfaUpdate posture check mfa update // -// swagger:model PostureCheckMfaUpdate +// swagger:model postureCheckMfaUpdate type PostureCheckMfaUpdate struct { nameField *string @@ -225,7 +226,51 @@ func (m *PostureCheckMfaUpdate) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostureCheckMfaUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckMfaUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -235,6 +280,18 @@ func (m *PostureCheckMfaUpdate) validateTags(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckMfaUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_operating_system_create.go b/rest_model/posture_check_operating_system_create.go index fc04ee510..d0a928efa 100644 --- a/rest_model/posture_check_operating_system_create.go +++ b/rest_model/posture_check_operating_system_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckOperatingSystemCreate posture check operating system create // -// swagger:model PostureCheckOperatingSystemCreate +// swagger:model postureCheckOperatingSystemCreate type PostureCheckOperatingSystemCreate struct { nameField *string @@ -250,11 +251,13 @@ func (m *PostureCheckOperatingSystemCreate) validateTags(formats strfmt.Registry return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -291,6 +294,82 @@ func (m *PostureCheckOperatingSystemCreate) validateOperatingSystems(formats str 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckOperatingSystemCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckOperatingSystemCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_operating_system_detail.go b/rest_model/posture_check_operating_system_detail.go index ea1b742f5..cdfa698a0 100644 --- a/rest_model/posture_check_operating_system_detail.go +++ b/rest_model/posture_check_operating_system_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckOperatingSystemDetail posture check operating system detail // -// swagger:model PostureCheckOperatingSystemDetail +// swagger:model postureCheckOperatingSystemDetail type PostureCheckOperatingSystemDetail struct { linksField Links @@ -341,11 +342,13 @@ func (m *PostureCheckOperatingSystemDetail) validateLinks(formats strfmt.Registr return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -404,11 +407,13 @@ func (m *PostureCheckOperatingSystemDetail) validateTags(formats strfmt.Registry return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -461,6 +466,86 @@ func (m *PostureCheckOperatingSystemDetail) validateOperatingSystems(formats str 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") + } + return err + } + + return nil +} + +func (m *PostureCheckOperatingSystemDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckOperatingSystemDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckOperatingSystemDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_operating_system_patch.go b/rest_model/posture_check_operating_system_patch.go index 1a08ecd0c..fb74cbecf 100644 --- a/rest_model/posture_check_operating_system_patch.go +++ b/rest_model/posture_check_operating_system_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckOperatingSystemPatch posture check operating system patch // -// swagger:model PostureCheckOperatingSystemPatch +// swagger:model postureCheckOperatingSystemPatch type PostureCheckOperatingSystemPatch struct { nameField string @@ -214,11 +215,13 @@ func (m *PostureCheckOperatingSystemPatch) validateTags(formats strfmt.Registry) return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -255,6 +258,70 @@ func (m *PostureCheckOperatingSystemPatch) validateOperatingSystems(formats strf 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckOperatingSystemPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckOperatingSystemPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_operating_system_update.go b/rest_model/posture_check_operating_system_update.go index 72b8863ba..cc9e2c313 100644 --- a/rest_model/posture_check_operating_system_update.go +++ b/rest_model/posture_check_operating_system_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckOperatingSystemUpdate posture check operating system update // -// swagger:model PostureCheckOperatingSystemUpdate +// swagger:model postureCheckOperatingSystemUpdate type PostureCheckOperatingSystemUpdate struct { nameField *string @@ -250,11 +251,13 @@ func (m *PostureCheckOperatingSystemUpdate) validateTags(formats strfmt.Registry return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -291,6 +294,82 @@ func (m *PostureCheckOperatingSystemUpdate) validateOperatingSystems(formats str 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckOperatingSystemUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckOperatingSystemUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_patch.go b/rest_model/posture_check_patch.go index f957f3c3a..7868fddca 100644 --- a/rest_model/posture_check_patch.go +++ b/rest_model/posture_check_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -44,9 +45,10 @@ import ( // PostureCheckPatch posture check patch // -// swagger:discriminator PostureCheckPatch typeId +// swagger:discriminator postureCheckPatch typeId type PostureCheckPatch interface { runtime.Validatable + runtime.ContextValidatable // name Name() string @@ -184,7 +186,7 @@ func unmarshalPostureCheckPatch(data []byte, consumer runtime.Consumer) (Posture return nil, err } return &result, nil - case "PostureCheckPatch": + case "postureCheckPatch": var result postureCheckPatch if err := consumer.Consume(buf2, &result); err != nil { return nil, err @@ -213,7 +215,6 @@ func (m *postureCheckPatch) Validate(formats strfmt.Registry) error { } func (m *postureCheckPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required return nil } @@ -229,12 +230,55 @@ func (m *postureCheckPatch) validateRoleAttributes(formats strfmt.Registry) erro } func (m *postureCheckPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *postureCheckPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *postureCheckPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/posture_check_process_create.go b/rest_model/posture_check_process_create.go index a5430a783..441083e71 100644 --- a/rest_model/posture_check_process_create.go +++ b/rest_model/posture_check_process_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckProcessCreate posture check process create // -// swagger:model PostureCheckProcessCreate +// swagger:model postureCheckProcessCreate type PostureCheckProcessCreate struct { nameField *string @@ -246,11 +247,13 @@ func (m *PostureCheckProcessCreate) validateTags(formats strfmt.Registry) error return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,78 @@ func (m *PostureCheckProcessCreate) validateProcess(formats strfmt.Registry) 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_detail.go b/rest_model/posture_check_process_detail.go index 692c09ca1..59f54860a 100644 --- a/rest_model/posture_check_process_detail.go +++ b/rest_model/posture_check_process_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckProcessDetail posture check process detail // -// swagger:model PostureCheckProcessDetail +// swagger:model postureCheckProcessDetail type PostureCheckProcessDetail struct { linksField Links @@ -340,11 +341,13 @@ func (m *PostureCheckProcessDetail) validateLinks(formats strfmt.Registry) error return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -403,11 +406,13 @@ func (m *PostureCheckProcessDetail) validateTags(formats strfmt.Registry) error return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -453,6 +458,82 @@ func (m *PostureCheckProcessDetail) validateProcess(formats strfmt.Registry) 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") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_multi_create.go b/rest_model/posture_check_process_multi_create.go index 791ae4d86..4b1fad53f 100644 --- a/rest_model/posture_check_process_multi_create.go +++ b/rest_model/posture_check_process_multi_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckProcessMultiCreate posture check process multi create // -// swagger:model PostureCheckProcessMultiCreate +// swagger:model postureCheckProcessMultiCreate type PostureCheckProcessMultiCreate struct { nameField *string @@ -57,7 +58,7 @@ type PostureCheckProcessMultiCreate struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } // Name gets the name of this subtype @@ -110,7 +111,7 @@ func (m *PostureCheckProcessMultiCreate) UnmarshalJSON(raw []byte) error { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } buf := bytes.NewBuffer(raw) dec := json.NewDecoder(buf) @@ -173,7 +174,7 @@ func (m PostureCheckProcessMultiCreate) MarshalJSON() ([]byte, error) { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` }{ Processes: m.Processes, @@ -269,11 +270,13 @@ func (m *PostureCheckProcessMultiCreate) validateTags(formats strfmt.Registry) e return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -312,9 +315,57 @@ func (m *PostureCheckProcessMultiCreate) validateProcesses(formats strfmt.Regist func (m *PostureCheckProcessMultiCreate) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { + 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") + } + 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") + return ve.ValidateName("roleAttributes") } return err } @@ -322,6 +373,62 @@ func (m *PostureCheckProcessMultiCreate) validateSemantic(formats strfmt.Registr return nil } +func (m *PostureCheckProcessMultiCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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)) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessMultiCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_multi_detail.go b/rest_model/posture_check_process_multi_detail.go index b175ea069..6d3c5c203 100644 --- a/rest_model/posture_check_process_multi_detail.go +++ b/rest_model/posture_check_process_multi_detail.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckProcessMultiDetail posture check process multi detail // -// swagger:model PostureCheckProcessMultiDetail +// swagger:model postureCheckProcessMultiDetail type PostureCheckProcessMultiDetail struct { linksField Links @@ -67,7 +68,7 @@ type PostureCheckProcessMultiDetail struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } // Links gets the links of this subtype @@ -170,7 +171,7 @@ func (m *PostureCheckProcessMultiDetail) UnmarshalJSON(raw []byte) error { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } buf := bytes.NewBuffer(raw) dec := json.NewDecoder(buf) @@ -252,7 +253,7 @@ func (m PostureCheckProcessMultiDetail) MarshalJSON() ([]byte, error) { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` }{ Processes: m.Processes, @@ -363,11 +364,13 @@ func (m *PostureCheckProcessMultiDetail) validateLinks(formats strfmt.Registry) return err } - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") + if m.Links() != nil { + if err := m.Links().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("_links") + } + return err } - return err } return nil @@ -426,11 +429,13 @@ func (m *PostureCheckProcessMultiDetail) validateTags(formats strfmt.Registry) e return err } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -491,9 +496,61 @@ func (m *PostureCheckProcessMultiDetail) validateProcesses(formats strfmt.Regist func (m *PostureCheckProcessMultiDetail) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { + 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") + } + 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("semantic") + return ve.ValidateName("_links") } return err } @@ -501,6 +558,62 @@ func (m *PostureCheckProcessMultiDetail) validateSemantic(formats strfmt.Registr return nil } +func (m *PostureCheckProcessMultiDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessMultiDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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)) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessMultiDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_multi_patch.go b/rest_model/posture_check_process_multi_patch.go index e247ebb75..041520b02 100644 --- a/rest_model/posture_check_process_multi_patch.go +++ b/rest_model/posture_check_process_multi_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckProcessMultiPatch posture check process multi patch // -// swagger:model PostureCheckProcessMultiPatch +// swagger:model postureCheckProcessMultiPatch type PostureCheckProcessMultiPatch struct { nameField string @@ -230,11 +231,13 @@ func (m *PostureCheckProcessMultiPatch) validateTags(formats strfmt.Registry) er return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -287,6 +290,86 @@ func (m *PostureCheckProcessMultiPatch) validateSemantic(formats strfmt.Registry 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessMultiPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + 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)) + } + 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessMultiPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_multi_update.go b/rest_model/posture_check_process_multi_update.go index 5868b1250..e29951364 100644 --- a/rest_model/posture_check_process_multi_update.go +++ b/rest_model/posture_check_process_multi_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "strconv" @@ -42,7 +43,7 @@ import ( // PostureCheckProcessMultiUpdate posture check process multi update // -// swagger:model PostureCheckProcessMultiUpdate +// swagger:model postureCheckProcessMultiUpdate type PostureCheckProcessMultiUpdate struct { nameField *string @@ -57,7 +58,7 @@ type PostureCheckProcessMultiUpdate struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } // Name gets the name of this subtype @@ -110,7 +111,7 @@ func (m *PostureCheckProcessMultiUpdate) UnmarshalJSON(raw []byte) error { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` } buf := bytes.NewBuffer(raw) dec := json.NewDecoder(buf) @@ -173,7 +174,7 @@ func (m PostureCheckProcessMultiUpdate) MarshalJSON() ([]byte, error) { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` }{ Processes: m.Processes, @@ -269,11 +270,13 @@ func (m *PostureCheckProcessMultiUpdate) validateTags(formats strfmt.Registry) e return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -312,9 +315,57 @@ func (m *PostureCheckProcessMultiUpdate) validateProcesses(formats strfmt.Regist func (m *PostureCheckProcessMultiUpdate) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { + 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") + } + 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") + return ve.ValidateName("roleAttributes") } return err } @@ -322,6 +373,62 @@ func (m *PostureCheckProcessMultiUpdate) validateSemantic(formats strfmt.Registr return nil } +func (m *PostureCheckProcessMultiUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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)) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessMultiUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_patch.go b/rest_model/posture_check_process_patch.go index 6a5c8bc26..7c7d9a8a0 100644 --- a/rest_model/posture_check_process_patch.go +++ b/rest_model/posture_check_process_patch.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -40,7 +41,7 @@ import ( // PostureCheckProcessPatch posture check process patch // -// swagger:model PostureCheckProcessPatch +// swagger:model postureCheckProcessPatch type PostureCheckProcessPatch struct { nameField string @@ -209,11 +210,13 @@ func (m *PostureCheckProcessPatch) validateTags(formats strfmt.Registry) error { return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -237,6 +240,66 @@ func (m *PostureCheckProcessPatch) validateProcess(formats strfmt.Registry) erro 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessPatch) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_process_update.go b/rest_model/posture_check_process_update.go index fa7c9d66d..3986b5390 100644 --- a/rest_model/posture_check_process_update.go +++ b/rest_model/posture_check_process_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureCheckProcessUpdate posture check process update // -// swagger:model PostureCheckProcessUpdate +// swagger:model postureCheckProcessUpdate type PostureCheckProcessUpdate struct { nameField *string @@ -246,11 +247,13 @@ func (m *PostureCheckProcessUpdate) validateTags(formats strfmt.Registry) error return nil } - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags") + } + return err } - return err } return nil @@ -274,6 +277,78 @@ func (m *PostureCheckProcessUpdate) validateProcess(formats strfmt.Registry) 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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *PostureCheckProcessUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckProcessUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_type.go b/rest_model/posture_check_type.go index 0316b631c..17e712a3e 100644 --- a/rest_model/posture_check_type.go +++ b/rest_model/posture_check_type.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model postureCheckType type PostureCheckType string +func NewPostureCheckType(value PostureCheckType) *PostureCheckType { + v := value + return &v +} + const ( // PostureCheckTypeOS captures enum value "OS" @@ -50,9 +56,6 @@ const ( // PostureCheckTypePROCESS captures enum value "PROCESS" PostureCheckTypePROCESS PostureCheckType = "PROCESS" - // PostureCheckTypePROCESSMULTI captures enum value "PROCESS_MULTI" - PostureCheckTypePROCESSMULTI PostureCheckType = "PROCESS_MULTI" - // PostureCheckTypeDOMAIN captures enum value "DOMAIN" PostureCheckTypeDOMAIN PostureCheckType = "DOMAIN" @@ -61,6 +64,9 @@ const ( // PostureCheckTypeMFA captures enum value "MFA" PostureCheckTypeMFA PostureCheckType = "MFA" + + // PostureCheckTypePROCESSMULTI captures enum value "PROCESS_MULTI" + PostureCheckTypePROCESSMULTI PostureCheckType = "PROCESS_MULTI" ) // for schema @@ -68,7 +74,7 @@ var postureCheckTypeEnum []interface{} func init() { var res []PostureCheckType - if err := json.Unmarshal([]byte(`["OS","PROCESS","PROCESS_MULTI","DOMAIN","MAC","MFA"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["OS","PROCESS","DOMAIN","MAC","MFA","PROCESS_MULTI"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -97,3 +103,8 @@ func (m PostureCheckType) Validate(formats strfmt.Registry) error { } 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 index cc76f929e..65407853f 100644 --- a/rest_model/posture_check_type_detail.go +++ b/rest_model/posture_check_type_detail.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -40,7 +41,7 @@ import ( // PostureCheckTypeDetail posture check type detail // -// swagger:model PostureCheckTypeDetail +// swagger:model postureCheckTypeDetail type PostureCheckTypeDetail struct { BaseEntity @@ -188,6 +189,43 @@ func (m *PostureCheckTypeDetail) validateVersion(formats strfmt.Registry) error 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureCheckTypeDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_check_type_list.go b/rest_model/posture_check_type_list.go index 1080d39cc..3364de1e1 100644 --- a/rest_model/posture_check_type_list.go +++ b/rest_model/posture_check_type_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -39,7 +40,7 @@ import ( // PostureCheckTypeList posture check type list // -// swagger:model PostureCheckTypeList +// swagger:model postureCheckTypeList type PostureCheckTypeList []*PostureCheckTypeDetail // Validate validates this posture check type list @@ -67,3 +68,26 @@ func (m PostureCheckTypeList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 6013ce34e..0cfe663d7 100644 --- a/rest_model/posture_check_update.go +++ b/rest_model/posture_check_update.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -44,9 +45,10 @@ import ( // PostureCheckUpdate posture check update // -// swagger:discriminator PostureCheckUpdate typeId +// swagger:discriminator postureCheckUpdate typeId type PostureCheckUpdate interface { runtime.Validatable + runtime.ContextValidatable // name // Required: true @@ -111,7 +113,7 @@ func (m *postureCheckUpdate) SetTags(val Tags) { // TypeID gets the type Id of this polymorphic type func (m *postureCheckUpdate) TypeID() PostureCheckType { - return "PostureCheckUpdate" + return "postureCheckUpdate" } // SetTypeID sets the type Id of this polymorphic type @@ -200,7 +202,7 @@ func unmarshalPostureCheckUpdate(data []byte, consumer runtime.Consumer) (Postur return nil, err } return &result, nil - case "PostureCheckUpdate": + case "postureCheckUpdate": var result postureCheckUpdate if err := consumer.Consume(buf2, &result); err != nil { return nil, err @@ -242,7 +244,6 @@ func (m *postureCheckUpdate) validateName(formats strfmt.Registry) error { } func (m *postureCheckUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required return nil } @@ -258,12 +259,59 @@ func (m *postureCheckUpdate) validateRoleAttributes(formats strfmt.Registry) err } func (m *postureCheckUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required return nil } - if err := m.Tags().Validate(formats); err != nil { + if m.Tags() != nil { + if err := m.Tags().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + +func (m *postureCheckUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags().ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -272,3 +320,15 @@ func (m *postureCheckUpdate) validateTags(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} diff --git a/rest_model/posture_data.go b/rest_model/posture_data.go index d611921e6..938d21c10 100644 --- a/rest_model/posture_data.go +++ b/rest_model/posture_data.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -96,6 +97,10 @@ func (m *PostureData) Validate(formats strfmt.Registry) error { 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 { @@ -191,6 +196,115 @@ func (m *PostureData) validateProcesses(formats strfmt.Registry) error { 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") + } + 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") + } + 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") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureData) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_data_base.go b/rest_model/posture_data_base.go index ca2435418..c769c4bff 100644 --- a/rest_model/posture_data_base.go +++ b/rest_model/posture_data_base.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -108,6 +110,11 @@ func (m *PostureDataBase) validateTimedOut(formats strfmt.Registry) error { 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 { diff --git a/rest_model/posture_data_domain.go b/rest_model/posture_data_domain.go index 1cfa3d6ff..45676d50b 100644 --- a/rest_model/posture_data_domain.go +++ b/rest_model/posture_data_domain.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -120,6 +122,21 @@ func (m *PostureDataDomain) validateDomain(formats strfmt.Registry) error { 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 { diff --git a/rest_model/get_identity_posture_data_envelope.go b/rest_model/posture_data_envelope.go similarity index 60% rename from rest_model/get_identity_posture_data_envelope.go rename to rest_model/posture_data_envelope.go index 44201ce35..75c457f22 100644 --- a/rest_model/get_identity_posture_data_envelope.go +++ b/rest_model/posture_data_envelope.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// GetIdentityPostureDataEnvelope get identity posture data envelope +// PostureDataEnvelope posture data envelope // -// swagger:model getIdentityPostureDataEnvelope -type GetIdentityPostureDataEnvelope struct { +// swagger:model postureDataEnvelope +type PostureDataEnvelope struct { // data // Required: true @@ -50,8 +52,8 @@ type GetIdentityPostureDataEnvelope struct { Meta *Meta `json:"meta"` } -// Validate validates this get identity posture data envelope -func (m *GetIdentityPostureDataEnvelope) Validate(formats strfmt.Registry) error { +// Validate validates this posture data envelope +func (m *PostureDataEnvelope) Validate(formats strfmt.Registry) error { var res []error if err := m.validateData(formats); err != nil { @@ -68,7 +70,7 @@ func (m *GetIdentityPostureDataEnvelope) Validate(formats strfmt.Registry) error return nil } -func (m *GetIdentityPostureDataEnvelope) validateData(formats strfmt.Registry) error { +func (m *PostureDataEnvelope) validateData(formats strfmt.Registry) error { if err := validate.Required("data", "body", m.Data); err != nil { return err @@ -86,7 +88,7 @@ func (m *GetIdentityPostureDataEnvelope) validateData(formats strfmt.Registry) e return nil } -func (m *GetIdentityPostureDataEnvelope) validateMeta(formats strfmt.Registry) error { +func (m *PostureDataEnvelope) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -104,8 +106,54 @@ func (m *GetIdentityPostureDataEnvelope) validateMeta(formats strfmt.Registry) e 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *GetIdentityPostureDataEnvelope) MarshalBinary() ([]byte, error) { +func (m *PostureDataEnvelope) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -113,8 +161,8 @@ func (m *GetIdentityPostureDataEnvelope) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *GetIdentityPostureDataEnvelope) UnmarshalBinary(b []byte) error { - var res GetIdentityPostureDataEnvelope +func (m *PostureDataEnvelope) UnmarshalBinary(b []byte) error { + var res PostureDataEnvelope if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/posture_data_mac.go b/rest_model/posture_data_mac.go index a6c939b3e..86cf1a26d 100644 --- a/rest_model/posture_data_mac.go +++ b/rest_model/posture_data_mac.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -120,6 +122,21 @@ func (m *PostureDataMac) validateAddresses(formats strfmt.Registry) error { 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 { diff --git a/rest_model/posture_data_mfa.go b/rest_model/posture_data_mfa.go index 27a7beb71..76bc88866 100644 --- a/rest_model/posture_data_mfa.go +++ b/rest_model/posture_data_mfa.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -86,6 +88,11 @@ func (m *PostureDataMfa) validatePassedMfa(formats strfmt.Registry) error { 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 { diff --git a/rest_model/posture_data_os.go b/rest_model/posture_data_os.go index 1093ea682..7c6a063a0 100644 --- a/rest_model/posture_data_os.go +++ b/rest_model/posture_data_os.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -170,6 +172,21 @@ func (m *PostureDataOs) validateVersion(formats strfmt.Registry) error { 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 { diff --git a/rest_model/posture_data_process.go b/rest_model/posture_data_process.go index dfe5ff198..af74c996d 100644 --- a/rest_model/posture_data_process.go +++ b/rest_model/posture_data_process.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -127,6 +129,21 @@ func (m *PostureDataProcess) Validate(formats strfmt.Registry) error { 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 { diff --git a/rest_model/posture_queries.go b/rest_model/posture_queries.go index f0da3f555..53a8650d3 100644 --- a/rest_model/posture_queries.go +++ b/rest_model/posture_queries.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -104,7 +105,6 @@ func (m *PostureQueries) validatePolicyID(formats strfmt.Registry) error { } func (m *PostureQueries) validatePolicyType(formats strfmt.Registry) error { - if swag.IsZero(m.PolicyType) { // not required return nil } @@ -144,6 +144,54 @@ func (m *PostureQueries) validatePostureQueries(formats strfmt.Registry) error { 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") + } + 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)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureQueries) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_query.go b/rest_model/posture_query.go index 6973fa17e..dcf5d2d17 100644 --- a/rest_model/posture_query.go +++ b/rest_model/posture_query.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -56,7 +57,7 @@ type PostureQuery struct { // query type // Required: true - QueryType PostureCheckType `json:"queryType"` + QueryType *PostureCheckType `json:"queryType"` // timeout // Required: true @@ -80,7 +81,7 @@ func (m *PostureQuery) UnmarshalJSON(raw []byte) error { Processes []*PostureQueryProcess `json:"processes"` - QueryType PostureCheckType `json:"queryType"` + QueryType *PostureCheckType `json:"queryType"` Timeout *int64 `json:"timeout"` } @@ -117,7 +118,7 @@ func (m PostureQuery) MarshalJSON() ([]byte, error) { Processes []*PostureQueryProcess `json:"processes"` - QueryType PostureCheckType `json:"queryType"` + QueryType *PostureCheckType `json:"queryType"` Timeout *int64 `json:"timeout"` } @@ -229,13 +230,23 @@ func (m *PostureQuery) validateProcesses(formats strfmt.Registry) error { func (m *PostureQuery) validateQueryType(formats strfmt.Registry) error { - if err := m.QueryType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queryType") - } + 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") + } + return err + } + } + return nil } @@ -248,6 +259,79 @@ func (m *PostureQuery) validateTimeout(formats strfmt.Registry) error { 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") + } + 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)) + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureQuery) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_query_process.go b/rest_model/posture_query_process.go index 7a5916136..2bed8dfb4 100644 --- a/rest_model/posture_query_process.go +++ b/rest_model/posture_query_process.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,7 +64,6 @@ func (m *PostureQueryProcess) Validate(formats strfmt.Registry) error { } func (m *PostureQueryProcess) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required return nil } @@ -77,6 +78,32 @@ func (m *PostureQueryProcess) validateOsType(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureQueryProcess) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_response_create.go b/rest_model/posture_response_create.go index 87ba1283e..5ff789a76 100644 --- a/rest_model/posture_response_create.go +++ b/rest_model/posture_response_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "io" "io/ioutil" @@ -43,9 +44,10 @@ import ( // PostureResponseCreate posture response create // -// swagger:discriminator PostureResponseCreate typeId +// swagger:discriminator postureResponseCreate typeId type PostureResponseCreate interface { runtime.Validatable + runtime.ContextValidatable // id // Required: true @@ -79,7 +81,7 @@ func (m *postureResponseCreate) SetID(val *string) { // TypeID gets the type Id of this polymorphic type func (m *postureResponseCreate) TypeID() PostureCheckType { - return "PostureResponseCreate" + return "postureResponseCreate" } // SetTypeID sets the type Id of this polymorphic type @@ -156,7 +158,7 @@ func unmarshalPostureResponseCreate(data []byte, consumer runtime.Consumer) (Pos return nil, err } return &result, nil - case "PostureResponseCreate": + case "postureResponseCreate": var result postureResponseCreate if err := consumer.Consume(buf2, &result); err != nil { return nil, err @@ -188,3 +190,29 @@ func (m *postureResponseCreate) validateID(formats strfmt.Registry) error { 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") + } + return err + } + + return nil +} diff --git a/rest_model/posture_response_domain_create.go b/rest_model/posture_response_domain_create.go index 0d80b15fd..81f37282e 100644 --- a/rest_model/posture_response_domain_create.go +++ b/rest_model/posture_response_domain_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureResponseDomainCreate posture response domain create // -// swagger:model PostureResponseDomainCreate +// swagger:model postureResponseDomainCreate type PostureResponseDomainCreate struct { idField *string @@ -185,6 +186,28 @@ func (m *PostureResponseDomainCreate) validateDomain(formats strfmt.Registry) er 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureResponseDomainCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_response_mac_address_create.go b/rest_model/posture_response_mac_address_create.go index 81d53b8b2..4318aaab6 100644 --- a/rest_model/posture_response_mac_address_create.go +++ b/rest_model/posture_response_mac_address_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureResponseMacAddressCreate posture response mac address create // -// swagger:model PostureResponseMacAddressCreate +// swagger:model postureResponseMacAddressCreate type PostureResponseMacAddressCreate struct { idField *string @@ -185,6 +186,28 @@ func (m *PostureResponseMacAddressCreate) validateMacAddresses(formats strfmt.Re 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureResponseMacAddressCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_response_operating_system_create.go b/rest_model/posture_response_operating_system_create.go index f126f4c45..205ba9de5 100644 --- a/rest_model/posture_response_operating_system_create.go +++ b/rest_model/posture_response_operating_system_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,7 +42,7 @@ import ( // PostureResponseOperatingSystemCreate posture response operating system create // -// swagger:model PostureResponseOperatingSystemCreate +// swagger:model postureResponseOperatingSystemCreate type PostureResponseOperatingSystemCreate struct { idField *string @@ -225,6 +226,28 @@ func (m *PostureResponseOperatingSystemCreate) validateVersion(formats strfmt.Re 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostureResponseOperatingSystemCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/posture_response_process_create.go b/rest_model/posture_response_process_create.go index a406ab41e..49631dcf9 100644 --- a/rest_model/posture_response_process_create.go +++ b/rest_model/posture_response_process_create.go @@ -31,6 +31,7 @@ package rest_model import ( "bytes" + "context" "encoding/json" "github.com/go-openapi/errors" @@ -41,24 +42,20 @@ import ( // PostureResponseProcessCreate posture response process create // -// swagger:model PostureResponseProcessCreate +// swagger:model postureResponseProcessCreate type PostureResponseProcessCreate struct { idField *string // hash - // Required: true - Hash *string `json:"hash"` + Hash string `json:"hash,omitempty"` // is running - // Required: true - IsRunning *bool `json:"isRunning"` + IsRunning bool `json:"isRunning,omitempty"` // path - // Required: true - Path *string `json:"path"` + Path string `json:"path,omitempty"` // signer fingerprints - // Required: true SignerFingerprints []string `json:"signerFingerprints"` } @@ -86,19 +83,15 @@ func (m *PostureResponseProcessCreate) UnmarshalJSON(raw []byte) error { var data struct { // hash - // Required: true - Hash *string `json:"hash"` + Hash string `json:"hash,omitempty"` // is running - // Required: true - IsRunning *bool `json:"isRunning"` + IsRunning bool `json:"isRunning,omitempty"` // path - // Required: true - Path *string `json:"path"` + Path string `json:"path,omitempty"` // signer fingerprints - // Required: true SignerFingerprints []string `json:"signerFingerprints"` } buf := bytes.NewBuffer(raw) @@ -150,19 +143,15 @@ func (m PostureResponseProcessCreate) MarshalJSON() ([]byte, error) { b1, err = json.Marshal(struct { // hash - // Required: true - Hash *string `json:"hash"` + Hash string `json:"hash,omitempty"` // is running - // Required: true - IsRunning *bool `json:"isRunning"` + IsRunning bool `json:"isRunning,omitempty"` // path - // Required: true - Path *string `json:"path"` + Path string `json:"path,omitempty"` // signer fingerprints - // Required: true SignerFingerprints []string `json:"signerFingerprints"` }{ @@ -202,22 +191,6 @@ func (m *PostureResponseProcessCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } - 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.validatePath(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...) } @@ -233,36 +206,22 @@ func (m *PostureResponseProcessCreate) validateID(formats strfmt.Registry) error return nil } -func (m *PostureResponseProcessCreate) validateHash(formats strfmt.Registry) error { +// 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 err := validate.Required("hash", "body", m.Hash); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - return nil } -func (m *PostureResponseProcessCreate) validateIsRunning(formats strfmt.Registry) error { +func (m *PostureResponseProcessCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - if err := validate.Required("isRunning", "body", m.IsRunning); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseProcessCreate) validatePath(formats strfmt.Registry) error { - - if err := validate.Required("path", "body", m.Path); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseProcessCreate) validateSignerFingerprints(formats strfmt.Registry) error { - - if err := validate.Required("signerFingerprints", "body", m.SignerFingerprints); err != nil { + if err := m.TypeID().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("typeId") + } return err } diff --git a/rest_model/process.go b/rest_model/process.go index 8fac98b4b..3bb5aac8d 100644 --- a/rest_model/process.go +++ b/rest_model/process.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -46,7 +48,7 @@ type Process struct { // os type // Required: true - OsType OsType `json:"osType"` + OsType *OsType `json:"osType"` // path // Required: true @@ -76,13 +78,23 @@ func (m *Process) Validate(formats strfmt.Registry) error { func (m *Process) validateOsType(formats strfmt.Registry) error { - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } + 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") + } + return err + } + } + return nil } @@ -95,6 +107,34 @@ func (m *Process) validatePath(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Process) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/process_multi.go b/rest_model/process_multi.go index 6f7a24622..91795ff7a 100644 --- a/rest_model/process_multi.go +++ b/rest_model/process_multi.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -46,7 +48,7 @@ type ProcessMulti struct { // os type // Required: true - OsType OsType `json:"osType"` + OsType *OsType `json:"osType"` // path // Required: true @@ -76,13 +78,23 @@ func (m *ProcessMulti) Validate(formats strfmt.Registry) error { func (m *ProcessMulti) validateOsType(formats strfmt.Registry) error { - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } + 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") + } + return err + } + } + return nil } @@ -95,6 +107,34 @@ func (m *ProcessMulti) validatePath(formats strfmt.Registry) error { 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ProcessMulti) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/protocol.go b/rest_model/protocol.go index 9d507e7aa..f328ec5e0 100644 --- a/rest_model/protocol.go +++ b/rest_model/protocol.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -69,6 +71,11 @@ func (m *Protocol) validateAddress(formats strfmt.Registry) error { 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 { diff --git a/rest_model/role_attributes_list.go b/rest_model/role_attributes_list.go index 7944bf35b..0471d0194 100644 --- a/rest_model/role_attributes_list.go +++ b/rest_model/role_attributes_list.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type RoleAttributesList []string 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 index faf48f50b..42f01ef8c 100644 --- a/rest_model/roles.go +++ b/rest_model/roles.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type Roles []string 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/transit_router_create.go b/rest_model/router_create.go similarity index 64% rename from rest_model/transit_router_create.go rename to rest_model/router_create.go index 6bc830599..71af473dc 100644 --- a/rest_model/transit_router_create.go +++ b/rest_model/router_create.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// TransitRouterCreate transit router create +// RouterCreate router create // -// swagger:model transitRouterCreate -type TransitRouterCreate struct { +// swagger:model routerCreate +type RouterCreate struct { // name // Required: true @@ -49,8 +51,8 @@ type TransitRouterCreate struct { Tags Tags `json:"tags"` } -// Validate validates this transit router create -func (m *TransitRouterCreate) Validate(formats strfmt.Registry) error { +// Validate validates this router create +func (m *RouterCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { @@ -67,7 +69,7 @@ func (m *TransitRouterCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *TransitRouterCreate) validateName(formats strfmt.Registry) error { +func (m *RouterCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -76,13 +78,40 @@ func (m *TransitRouterCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *TransitRouterCreate) validateTags(formats strfmt.Registry) error { - +func (m *RouterCreate) validateTags(formats strfmt.Registry) error { if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -93,7 +122,7 @@ func (m *TransitRouterCreate) validateTags(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *TransitRouterCreate) MarshalBinary() ([]byte, error) { +func (m *RouterCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -101,8 +130,8 @@ func (m *TransitRouterCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *TransitRouterCreate) UnmarshalBinary(b []byte) error { - var res TransitRouterCreate +func (m *RouterCreate) UnmarshalBinary(b []byte) error { + var res RouterCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/transit_router_detail.go b/rest_model/router_detail.go similarity index 82% rename from rest_model/transit_router_detail.go rename to rest_model/router_detail.go index 2be9e7fb1..5b5c2f353 100644 --- a/rest_model/transit_router_detail.go +++ b/rest_model/router_detail.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// TransitRouterDetail transit router detail +// RouterDetail router detail // -// swagger:model transitRouterDetail -type TransitRouterDetail struct { +// swagger:model routerDetail +type RouterDetail struct { BaseEntity // enrollment created at @@ -74,7 +76,7 @@ type TransitRouterDetail struct { } // UnmarshalJSON unmarshals this object from a JSON structure -func (m *TransitRouterDetail) UnmarshalJSON(raw []byte) error { +func (m *RouterDetail) UnmarshalJSON(raw []byte) error { // AO0 var aO0 BaseEntity if err := swag.ReadJSON(raw, &aO0); err != nil { @@ -124,7 +126,7 @@ func (m *TransitRouterDetail) UnmarshalJSON(raw []byte) error { } // MarshalJSON marshals this object to a JSON structure -func (m TransitRouterDetail) MarshalJSON() ([]byte, error) { +func (m RouterDetail) MarshalJSON() ([]byte, error) { _parts := make([][]byte, 0, 2) aO0, err := swag.WriteJSON(m.BaseEntity) @@ -174,8 +176,8 @@ func (m TransitRouterDetail) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(_parts...), nil } -// Validate validates this transit router detail -func (m *TransitRouterDetail) Validate(formats strfmt.Registry) error { +// Validate validates this router detail +func (m *RouterDetail) Validate(formats strfmt.Registry) error { var res []error // validation for a type composition with BaseEntity @@ -213,7 +215,7 @@ func (m *TransitRouterDetail) Validate(formats strfmt.Registry) error { return nil } -func (m *TransitRouterDetail) validateEnrollmentCreatedAt(formats strfmt.Registry) error { +func (m *RouterDetail) validateEnrollmentCreatedAt(formats strfmt.Registry) error { if swag.IsZero(m.EnrollmentCreatedAt) { // not required return nil @@ -226,7 +228,7 @@ func (m *TransitRouterDetail) validateEnrollmentCreatedAt(formats strfmt.Registr return nil } -func (m *TransitRouterDetail) validateEnrollmentExpiresAt(formats strfmt.Registry) error { +func (m *RouterDetail) validateEnrollmentExpiresAt(formats strfmt.Registry) error { if swag.IsZero(m.EnrollmentExpiresAt) { // not required return nil @@ -239,7 +241,7 @@ func (m *TransitRouterDetail) validateEnrollmentExpiresAt(formats strfmt.Registr return nil } -func (m *TransitRouterDetail) validateFingerprint(formats strfmt.Registry) error { +func (m *RouterDetail) validateFingerprint(formats strfmt.Registry) error { if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { return err @@ -248,7 +250,7 @@ func (m *TransitRouterDetail) validateFingerprint(formats strfmt.Registry) error return nil } -func (m *TransitRouterDetail) validateIsOnline(formats strfmt.Registry) error { +func (m *RouterDetail) validateIsOnline(formats strfmt.Registry) error { if err := validate.Required("isOnline", "body", m.IsOnline); err != nil { return err @@ -257,7 +259,7 @@ func (m *TransitRouterDetail) validateIsOnline(formats strfmt.Registry) error { return nil } -func (m *TransitRouterDetail) validateIsVerified(formats strfmt.Registry) error { +func (m *RouterDetail) validateIsVerified(formats strfmt.Registry) error { if err := validate.Required("isVerified", "body", m.IsVerified); err != nil { return err @@ -266,7 +268,7 @@ func (m *TransitRouterDetail) validateIsVerified(formats strfmt.Registry) error return nil } -func (m *TransitRouterDetail) validateName(formats strfmt.Registry) error { +func (m *RouterDetail) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -275,8 +277,23 @@ func (m *TransitRouterDetail) validateName(formats strfmt.Registry) error { 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 *TransitRouterDetail) MarshalBinary() ([]byte, error) { +func (m *RouterDetail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -284,8 +301,8 @@ func (m *TransitRouterDetail) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *TransitRouterDetail) UnmarshalBinary(b []byte) error { - var res TransitRouterDetail +func (m *RouterDetail) UnmarshalBinary(b []byte) error { + var res RouterDetail if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/router_entity_ref.go b/rest_model/router_entity_ref.go index 7d2cc0bc7..27bbf224d 100644 --- a/rest_model/router_entity_ref.go +++ b/rest_model/router_entity_ref.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -120,6 +122,21 @@ func (m *RouterEntityRef) validateIsOnline(formats strfmt.Registry) error { 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 { diff --git a/rest_model/router_extend_enrollment_request.go b/rest_model/router_extend_enrollment_request.go index 5e7944281..ad288af2a 100644 --- a/rest_model/router_extend_enrollment_request.go +++ b/rest_model/router_extend_enrollment_request.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -86,6 +88,11 @@ func (m *RouterExtendEnrollmentRequest) validateServerCertCsr(formats strfmt.Reg 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 { diff --git a/rest_model/geo_region_list.go b/rest_model/router_list.go similarity index 70% rename from rest_model/geo_region_list.go rename to rest_model/router_list.go index 32ff4b767..3cc3f9fe0 100644 --- a/rest_model/geo_region_list.go +++ b/rest_model/router_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,13 +38,13 @@ import ( "github.com/go-openapi/swag" ) -// GeoRegionList geo region list +// RouterList router list // -// swagger:model geoRegionList -type GeoRegionList []*GeoRegionDetail +// swagger:model routerList +type RouterList []*RouterDetail -// Validate validates this geo region list -func (m GeoRegionList) Validate(formats strfmt.Registry) error { +// Validate validates this router list +func (m RouterList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -67,3 +68,26 @@ func (m GeoRegionList) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/transit_router_patch.go b/rest_model/router_patch.go similarity index 63% rename from rest_model/transit_router_patch.go rename to rest_model/router_patch.go index ea915dcc6..c3a5e48bb 100644 --- a/rest_model/transit_router_patch.go +++ b/rest_model/router_patch.go @@ -30,15 +30,17 @@ package rest_model // 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" ) -// TransitRouterPatch transit router patch +// RouterPatch router patch // -// swagger:model transitRouterPatch -type TransitRouterPatch struct { +// swagger:model routerPatch +type RouterPatch struct { // name Name string `json:"name,omitempty"` @@ -47,8 +49,8 @@ type TransitRouterPatch struct { Tags Tags `json:"tags"` } -// Validate validates this transit router patch -func (m *TransitRouterPatch) Validate(formats strfmt.Registry) error { +// Validate validates this router patch +func (m *RouterPatch) Validate(formats strfmt.Registry) error { var res []error if err := m.validateTags(formats); err != nil { @@ -61,13 +63,40 @@ func (m *TransitRouterPatch) Validate(formats strfmt.Registry) error { return nil } -func (m *TransitRouterPatch) validateTags(formats strfmt.Registry) error { - +func (m *RouterPatch) validateTags(formats strfmt.Registry) error { if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -78,7 +107,7 @@ func (m *TransitRouterPatch) validateTags(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *TransitRouterPatch) MarshalBinary() ([]byte, error) { +func (m *RouterPatch) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -86,8 +115,8 @@ func (m *TransitRouterPatch) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *TransitRouterPatch) UnmarshalBinary(b []byte) error { - var res TransitRouterPatch +func (m *RouterPatch) UnmarshalBinary(b []byte) error { + var res RouterPatch if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/transit_router_update.go b/rest_model/router_update.go similarity index 64% rename from rest_model/transit_router_update.go rename to rest_model/router_update.go index ee601f946..8467fa5eb 100644 --- a/rest_model/transit_router_update.go +++ b/rest_model/router_update.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// TransitRouterUpdate transit router update +// RouterUpdate router update // -// swagger:model transitRouterUpdate -type TransitRouterUpdate struct { +// swagger:model routerUpdate +type RouterUpdate struct { // name // Required: true @@ -49,8 +51,8 @@ type TransitRouterUpdate struct { Tags Tags `json:"tags"` } -// Validate validates this transit router update -func (m *TransitRouterUpdate) Validate(formats strfmt.Registry) error { +// Validate validates this router update +func (m *RouterUpdate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { @@ -67,7 +69,7 @@ func (m *TransitRouterUpdate) Validate(formats strfmt.Registry) error { return nil } -func (m *TransitRouterUpdate) validateName(formats strfmt.Registry) error { +func (m *RouterUpdate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -76,13 +78,40 @@ func (m *TransitRouterUpdate) validateName(formats strfmt.Registry) error { return nil } -func (m *TransitRouterUpdate) validateTags(formats strfmt.Registry) error { - +func (m *RouterUpdate) validateTags(formats strfmt.Registry) error { if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -93,7 +122,7 @@ func (m *TransitRouterUpdate) validateTags(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *TransitRouterUpdate) MarshalBinary() ([]byte, error) { +func (m *RouterUpdate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -101,8 +130,8 @@ func (m *TransitRouterUpdate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *TransitRouterUpdate) UnmarshalBinary(b []byte) error { - var res TransitRouterUpdate +func (m *RouterUpdate) UnmarshalBinary(b []byte) error { + var res RouterUpdate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/sdk_info.go b/rest_model/sdk_info.go index 4b7b3ae1c..26b5619d2 100644 --- a/rest_model/sdk_info.go +++ b/rest_model/sdk_info.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -63,6 +65,11 @@ 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 { diff --git a/rest_model/semantic.go b/rest_model/semantic.go index 63c1b8699..00b4ce704 100644 --- a/rest_model/semantic.go +++ b/rest_model/semantic.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model semantic type Semantic string +func NewSemantic(value Semantic) *Semantic { + v := value + return &v +} + const ( // SemanticAllOf captures enum value "AllOf" @@ -85,3 +91,8 @@ func (m Semantic) Validate(formats strfmt.Registry) error { } 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 index 11a44b415..83075772d 100644 --- a/rest_model/service_config_assign.go +++ b/rest_model/service_config_assign.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -86,6 +88,11 @@ func (m *ServiceConfigAssign) validateServiceID(formats strfmt.Registry) error { 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 { diff --git a/rest_model/service_config_detail.go b/rest_model/service_config_detail.go index 053b20adc..abc28bd32 100644 --- a/rest_model/service_config_detail.go +++ b/rest_model/service_config_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,6 +39,7 @@ import ( ) // 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 { @@ -138,6 +141,52 @@ func (m *ServiceConfigDetail) validateServiceID(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceConfigDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/service_config_list.go b/rest_model/service_config_list.go index 1877fe88d..8db4aa294 100644 --- a/rest_model/service_config_list.go +++ b/rest_model/service_config_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ServiceConfigList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 2dffe246a..a5e16728f 100644 --- a/rest_model/service_configs_assign_list.go +++ b/rest_model/service_configs_assign_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ServiceConfigsAssignList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index b6cf3fefa..2692e150d 100644 --- a/rest_model/service_create.go +++ b/rest_model/service_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -103,12 +105,39 @@ func (m *ServiceCreate) validateName(formats strfmt.Registry) error { } func (m *ServiceCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/service_detail.go b/rest_model/service_detail.go index 7e15a219f..f35a6ef81 100644 --- a/rest_model/service_detail.go +++ b/rest_model/service_detail.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -227,17 +228,21 @@ func (m *ServiceDetail) Validate(formats strfmt.Registry) error { 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 } - for kk := range m.Config[k] { + if err := validate.Required("config"+"."+k, "body", m.Config); err != nil { + return err + } - if err := validate.Required("config"+"."+k+"."+kk, "body", m.Config[k][kk]); 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 @@ -343,6 +348,75 @@ func (m *ServiceDetail) validateTerminatorStrategy(formats strfmt.Registry) erro 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") + } + 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)) + } + return err + } + } + + } + + return nil +} + +func (m *ServiceDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roleAttributes") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/service_edge_router_policy_create.go b/rest_model/service_edge_router_policy_create.go index 6d9983bf0..c1ef2d4cf 100644 --- a/rest_model/service_edge_router_policy_create.go +++ b/rest_model/service_edge_router_policy_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -89,7 +91,6 @@ func (m *ServiceEdgeRouterPolicyCreate) Validate(formats strfmt.Registry) error } func (m *ServiceEdgeRouterPolicyCreate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -114,7 +115,6 @@ func (m *ServiceEdgeRouterPolicyCreate) validateName(formats strfmt.Registry) er } func (m *ServiceEdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -130,7 +130,6 @@ func (m *ServiceEdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry } func (m *ServiceEdgeRouterPolicyCreate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -146,12 +145,87 @@ func (m *ServiceEdgeRouterPolicyCreate) validateServiceRoles(formats strfmt.Regi } func (m *ServiceEdgeRouterPolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + +func (m *ServiceEdgeRouterPolicyCreate) 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServiceEdgeRouterPolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/service_edge_router_policy_detail.go b/rest_model/service_edge_router_policy_detail.go index ec1f004a6..7a2232ffc 100644 --- a/rest_model/service_edge_router_policy_detail.go +++ b/rest_model/service_edge_router_policy_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -56,7 +58,7 @@ type ServiceEdgeRouterPolicyDetail struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` // service roles // Required: true @@ -84,7 +86,7 @@ func (m *ServiceEdgeRouterPolicyDetail) UnmarshalJSON(raw []byte) error { Name *string `json:"name"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` ServiceRoles Roles `json:"serviceRoles"` @@ -125,7 +127,7 @@ func (m ServiceEdgeRouterPolicyDetail) MarshalJSON() ([]byte, error) { Name *string `json:"name"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` ServiceRoles Roles `json:"serviceRoles"` @@ -234,13 +236,23 @@ func (m *ServiceEdgeRouterPolicyDetail) validateName(formats strfmt.Registry) er func (m *ServiceEdgeRouterPolicyDetail) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } + 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") + } + return err + } + } + return nil } @@ -276,6 +288,103 @@ func (m *ServiceEdgeRouterPolicyDetail) validateServiceRolesDisplay(formats strf 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceEdgeRouterPolicyDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/service_edge_router_policy_list.go b/rest_model/service_edge_router_policy_list.go index f7fe57512..871b9a987 100644 --- a/rest_model/service_edge_router_policy_list.go +++ b/rest_model/service_edge_router_policy_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ServiceEdgeRouterPolicyList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 476fbed8c..1f2174259 100644 --- a/rest_model/service_edge_router_policy_patch.go +++ b/rest_model/service_edge_router_policy_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -83,7 +85,6 @@ func (m *ServiceEdgeRouterPolicyPatch) Validate(formats strfmt.Registry) error { } func (m *ServiceEdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -99,7 +100,6 @@ func (m *ServiceEdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Re } func (m *ServiceEdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -115,7 +115,6 @@ func (m *ServiceEdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) } func (m *ServiceEdgeRouterPolicyPatch) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -131,12 +130,87 @@ func (m *ServiceEdgeRouterPolicyPatch) validateServiceRoles(formats strfmt.Regis } func (m *ServiceEdgeRouterPolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServiceEdgeRouterPolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/service_edge_router_policy_update.go b/rest_model/service_edge_router_policy_update.go index 562eb071b..d0befdb61 100644 --- a/rest_model/service_edge_router_policy_update.go +++ b/rest_model/service_edge_router_policy_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -89,7 +91,6 @@ func (m *ServiceEdgeRouterPolicyUpdate) Validate(formats strfmt.Registry) error } func (m *ServiceEdgeRouterPolicyUpdate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required return nil } @@ -114,7 +115,6 @@ func (m *ServiceEdgeRouterPolicyUpdate) validateName(formats strfmt.Registry) er } func (m *ServiceEdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -130,7 +130,6 @@ func (m *ServiceEdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry } func (m *ServiceEdgeRouterPolicyUpdate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -146,12 +145,87 @@ func (m *ServiceEdgeRouterPolicyUpdate) validateServiceRoles(formats strfmt.Regi } func (m *ServiceEdgeRouterPolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + return err + } + + return nil +} + +func (m *ServiceEdgeRouterPolicyUpdate) 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServiceEdgeRouterPolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/service_list.go b/rest_model/service_list.go index 9ed247039..da4d88732 100644 --- a/rest_model/service_list.go +++ b/rest_model/service_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ServiceList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 6b4e9aaf1..5e9327da8 100644 --- a/rest_model/service_patch.go +++ b/rest_model/service_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -74,12 +76,39 @@ func (m *ServicePatch) Validate(formats strfmt.Registry) error { } func (m *ServicePatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/service_policy_create.go b/rest_model/service_policy_create.go index e98205834..731057035 100644 --- a/rest_model/service_policy_create.go +++ b/rest_model/service_policy_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,7 +64,7 @@ type ServicePolicyCreate struct { // type // Required: true - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } // Validate validates this service policy create @@ -104,7 +106,6 @@ func (m *ServicePolicyCreate) Validate(formats strfmt.Registry) error { } func (m *ServicePolicyCreate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -129,7 +130,6 @@ func (m *ServicePolicyCreate) validateName(formats strfmt.Registry) error { } func (m *ServicePolicyCreate) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required return nil } @@ -145,7 +145,6 @@ func (m *ServicePolicyCreate) validatePostureCheckRoles(formats strfmt.Registry) } func (m *ServicePolicyCreate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -161,7 +160,6 @@ func (m *ServicePolicyCreate) validateSemantic(formats strfmt.Registry) error { } func (m *ServicePolicyCreate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -177,12 +175,129 @@ func (m *ServicePolicyCreate) validateServiceRoles(formats strfmt.Registry) erro } func (m *ServicePolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServicePolicyCreate) 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServicePolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -192,13 +307,15 @@ func (m *ServicePolicyCreate) validateTags(formats strfmt.Registry) error { return nil } -func (m *ServicePolicyCreate) validateType(formats strfmt.Registry) error { +func (m *ServicePolicyCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err } - return err } return nil diff --git a/rest_model/service_policy_detail.go b/rest_model/service_policy_detail.go index c4043ebf5..7a20ea9d7 100644 --- a/rest_model/service_policy_detail.go +++ b/rest_model/service_policy_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -64,7 +66,7 @@ type ServicePolicyDetail struct { // semantic // Required: true - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` // service roles // Required: true @@ -76,7 +78,7 @@ type ServicePolicyDetail struct { // type // Required: true - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } // UnmarshalJSON unmarshals this object from a JSON structure @@ -100,13 +102,13 @@ func (m *ServicePolicyDetail) UnmarshalJSON(raw []byte) error { PostureCheckRolesDisplay NamedRoles `json:"postureCheckRolesDisplay"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` ServiceRoles Roles `json:"serviceRoles"` ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err @@ -153,13 +155,13 @@ func (m ServicePolicyDetail) MarshalJSON() ([]byte, error) { PostureCheckRolesDisplay NamedRoles `json:"postureCheckRolesDisplay"` - Semantic Semantic `json:"semantic"` + Semantic *Semantic `json:"semantic"` ServiceRoles Roles `json:"serviceRoles"` ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } dataAO1.IdentityRoles = m.IdentityRoles @@ -314,13 +316,23 @@ func (m *ServicePolicyDetail) validatePostureCheckRolesDisplay(formats strfmt.Re func (m *ServicePolicyDetail) validateSemantic(formats strfmt.Registry) error { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } + 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") + } + return err + } + } + return nil } @@ -358,9 +370,78 @@ func (m *ServicePolicyDetail) validateServiceRolesDisplay(formats strfmt.Registr func (m *ServicePolicyDetail) validateType(formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { + 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") + } + 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("type") + return ve.ValidateName("identityRoles") } return err } @@ -368,6 +449,94 @@ func (m *ServicePolicyDetail) validateType(formats strfmt.Registry) error { 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ServicePolicyDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/service_policy_list.go b/rest_model/service_policy_list.go index d8c8ed4cc..eb89d3616 100644 --- a/rest_model/service_policy_list.go +++ b/rest_model/service_policy_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m ServicePolicyList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 0d319d99d..6d9c6291a 100644 --- a/rest_model/service_policy_patch.go +++ b/rest_model/service_policy_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -97,7 +99,6 @@ func (m *ServicePolicyPatch) Validate(formats strfmt.Registry) error { } func (m *ServicePolicyPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -113,7 +114,6 @@ func (m *ServicePolicyPatch) validateIdentityRoles(formats strfmt.Registry) erro } func (m *ServicePolicyPatch) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required return nil } @@ -129,7 +129,6 @@ func (m *ServicePolicyPatch) validatePostureCheckRoles(formats strfmt.Registry) } func (m *ServicePolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -145,7 +144,6 @@ func (m *ServicePolicyPatch) validateSemantic(formats strfmt.Registry) error { } func (m *ServicePolicyPatch) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -161,12 +159,122 @@ func (m *ServicePolicyPatch) validateServiceRoles(formats strfmt.Registry) error } func (m *ServicePolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServicePolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -176,13 +284,9 @@ func (m *ServicePolicyPatch) validateTags(formats strfmt.Registry) error { return nil } -func (m *ServicePolicyPatch) validateType(formats strfmt.Registry) error { +func (m *ServicePolicyPatch) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") } diff --git a/rest_model/service_policy_update.go b/rest_model/service_policy_update.go index 8a04597c2..66388fe9c 100644 --- a/rest_model/service_policy_update.go +++ b/rest_model/service_policy_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -62,7 +64,7 @@ type ServicePolicyUpdate struct { // type // Required: true - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } // Validate validates this service policy update @@ -104,7 +106,6 @@ func (m *ServicePolicyUpdate) Validate(formats strfmt.Registry) error { } func (m *ServicePolicyUpdate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required return nil } @@ -129,7 +130,6 @@ func (m *ServicePolicyUpdate) validateName(formats strfmt.Registry) error { } func (m *ServicePolicyUpdate) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required return nil } @@ -145,7 +145,6 @@ func (m *ServicePolicyUpdate) validatePostureCheckRoles(formats strfmt.Registry) } func (m *ServicePolicyUpdate) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required return nil } @@ -161,7 +160,6 @@ func (m *ServicePolicyUpdate) validateSemantic(formats strfmt.Registry) error { } func (m *ServicePolicyUpdate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required return nil } @@ -177,12 +175,129 @@ func (m *ServicePolicyUpdate) validateServiceRoles(formats strfmt.Registry) erro } func (m *ServicePolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServicePolicyUpdate) 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") + } + 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") + } + return err + } + + return nil +} + +func (m *ServicePolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -192,13 +307,15 @@ func (m *ServicePolicyUpdate) validateTags(formats strfmt.Registry) error { return nil } -func (m *ServicePolicyUpdate) validateType(formats strfmt.Registry) error { +func (m *ServicePolicyUpdate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") + if m.Type != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err } - return err } return nil diff --git a/rest_model/service_update.go b/rest_model/service_update.go index a15a7a248..ed8587746 100644 --- a/rest_model/service_update.go +++ b/rest_model/service_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -89,12 +91,39 @@ func (m *ServiceUpdate) validateName(formats strfmt.Registry) error { } func (m *ServiceUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/session_create.go b/rest_model/session_create.go index b468a400d..bd4a8ca74 100644 --- a/rest_model/session_create.go +++ b/rest_model/session_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -69,12 +71,58 @@ func (m *SessionCreate) Validate(formats strfmt.Registry) error { } func (m *SessionCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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 err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } @@ -84,13 +132,9 @@ func (m *SessionCreate) validateTags(formats strfmt.Registry) error { return nil } -func (m *SessionCreate) validateType(formats strfmt.Registry) error { +func (m *SessionCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { + if err := m.Type.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") } diff --git a/rest_model/session_create_envelope.go b/rest_model/session_create_envelope.go index f7f22f41e..9ca71b99b 100644 --- a/rest_model/session_create_envelope.go +++ b/rest_model/session_create_envelope.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -66,7 +68,6 @@ func (m *SessionCreateEnvelope) Validate(formats strfmt.Registry) error { } func (m *SessionCreateEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -84,7 +85,6 @@ func (m *SessionCreateEnvelope) validateData(formats strfmt.Registry) error { } func (m *SessionCreateEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required return nil } @@ -101,6 +101,52 @@ func (m *SessionCreateEnvelope) validateMeta(formats strfmt.Registry) error { 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SessionCreateEnvelope) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/session_detail.go b/rest_model/session_detail.go index 289a7b2bf..3d398adff 100644 --- a/rest_model/session_detail.go +++ b/rest_model/session_detail.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -70,7 +71,7 @@ type SessionDetail struct { // type // Required: true - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } // UnmarshalJSON unmarshals this object from a JSON structure @@ -96,7 +97,7 @@ func (m *SessionDetail) UnmarshalJSON(raw []byte) error { Token *string `json:"token"` - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err @@ -141,7 +142,7 @@ func (m SessionDetail) MarshalJSON() ([]byte, error) { Token *string `json:"token"` - Type DialBind `json:"type"` + Type *DialBind `json:"type"` } dataAO1.APISession = m.APISession @@ -299,13 +300,114 @@ func (m *SessionDetail) validateToken(formats strfmt.Registry) error { func (m *SessionDetail) validateType(formats strfmt.Registry) error { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } + 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") + } + 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") + } + 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)) + } + 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") + } + 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") + } + return err + } + } + return nil } diff --git a/rest_model/session_edge_router.go b/rest_model/session_edge_router.go index cb7dc1863..60ed92873 100644 --- a/rest_model/session_edge_router.go +++ b/rest_model/session_edge_router.go @@ -30,9 +30,12 @@ package rest_model // 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 @@ -112,6 +115,25 @@ func (m *SessionEdgeRouter) Validate(formats strfmt.Registry) error { 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 } diff --git a/rest_model/session_list.go b/rest_model/session_list.go index 2dc490de6..163b9b8ff 100644 --- a/rest_model/session_list.go +++ b/rest_model/session_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m SessionList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 9bb7d2564..ef81a214c 100644 --- a/rest_model/session_route_path_detail.go +++ b/rest_model/session_route_path_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -48,6 +50,11 @@ 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 { diff --git a/rest_model/spec_body_detail.go b/rest_model/spec_body_detail.go index 3d82bea45..6ab01a886 100644 --- a/rest_model/spec_body_detail.go +++ b/rest_model/spec_body_detail.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type SpecBodyDetail string 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 index dca4eea32..7690754ad 100644 --- a/rest_model/spec_detail.go +++ b/rest_model/spec_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -120,6 +122,21 @@ func (m *SpecDetail) validateName(formats strfmt.Registry) error { 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 { diff --git a/rest_model/spec_list.go b/rest_model/spec_list.go index ac65ac466..f9be62f25 100644 --- a/rest_model/spec_list.go +++ b/rest_model/spec_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m SpecList) Validate(formats strfmt.Registry) error { } 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)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_model/tags.go b/rest_model/tags.go index 0c4ae5955..0c7691ab3 100644 --- a/rest_model/tags.go +++ b/rest_model/tags.go @@ -30,6 +30,8 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -42,3 +44,8 @@ type Tags map[string]interface{} func (m Tags) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this tags based on context it is used +func (m Tags) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/rest_model/terminator_detail_limited.go b/rest_model/terminator_client_detail.go similarity index 71% rename from rest_model/terminator_detail_limited.go rename to rest_model/terminator_client_detail.go index a1d1648c1..da9f31ae1 100644 --- a/rest_model/terminator_detail_limited.go +++ b/rest_model/terminator_client_detail.go @@ -30,16 +30,18 @@ package rest_model // 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" ) -// TerminatorDetailLimited terminator detail limited +// TerminatorClientDetail terminator client detail // -// swagger:model terminatorDetailLimited -type TerminatorDetailLimited struct { +// swagger:model terminatorClientDetail +type TerminatorClientDetail struct { BaseEntity // identity @@ -60,7 +62,7 @@ type TerminatorDetailLimited struct { } // UnmarshalJSON unmarshals this object from a JSON structure -func (m *TerminatorDetailLimited) UnmarshalJSON(raw []byte) error { +func (m *TerminatorClientDetail) UnmarshalJSON(raw []byte) error { // AO0 var aO0 BaseEntity if err := swag.ReadJSON(raw, &aO0); err != nil { @@ -94,7 +96,7 @@ func (m *TerminatorDetailLimited) UnmarshalJSON(raw []byte) error { } // MarshalJSON marshals this object to a JSON structure -func (m TerminatorDetailLimited) MarshalJSON() ([]byte, error) { +func (m TerminatorClientDetail) MarshalJSON() ([]byte, error) { _parts := make([][]byte, 0, 2) aO0, err := swag.WriteJSON(m.BaseEntity) @@ -128,8 +130,8 @@ func (m TerminatorDetailLimited) MarshalJSON() ([]byte, error) { return swag.ConcatJSON(_parts...), nil } -// Validate validates this terminator detail limited -func (m *TerminatorDetailLimited) Validate(formats strfmt.Registry) error { +// Validate validates this terminator client detail +func (m *TerminatorClientDetail) Validate(formats strfmt.Registry) error { var res []error // validation for a type composition with BaseEntity @@ -159,7 +161,7 @@ func (m *TerminatorDetailLimited) Validate(formats strfmt.Registry) error { return nil } -func (m *TerminatorDetailLimited) validateIdentity(formats strfmt.Registry) error { +func (m *TerminatorClientDetail) validateIdentity(formats strfmt.Registry) error { if err := validate.Required("identity", "body", m.Identity); err != nil { return err @@ -168,7 +170,7 @@ func (m *TerminatorDetailLimited) validateIdentity(formats strfmt.Registry) erro return nil } -func (m *TerminatorDetailLimited) validateRouterID(formats strfmt.Registry) error { +func (m *TerminatorClientDetail) validateRouterID(formats strfmt.Registry) error { if err := validate.Required("routerId", "body", m.RouterID); err != nil { return err @@ -177,7 +179,7 @@ func (m *TerminatorDetailLimited) validateRouterID(formats strfmt.Registry) erro return nil } -func (m *TerminatorDetailLimited) validateService(formats strfmt.Registry) error { +func (m *TerminatorClientDetail) validateService(formats strfmt.Registry) error { if err := validate.Required("service", "body", m.Service); err != nil { return err @@ -195,7 +197,7 @@ func (m *TerminatorDetailLimited) validateService(formats strfmt.Registry) error return nil } -func (m *TerminatorDetailLimited) validateServiceID(formats strfmt.Registry) error { +func (m *TerminatorClientDetail) validateServiceID(formats strfmt.Registry) error { if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { return err @@ -204,8 +206,41 @@ func (m *TerminatorDetailLimited) validateServiceID(formats strfmt.Registry) 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation -func (m *TerminatorDetailLimited) MarshalBinary() ([]byte, error) { +func (m *TerminatorClientDetail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -213,8 +248,8 @@ func (m *TerminatorDetailLimited) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *TerminatorDetailLimited) UnmarshalBinary(b []byte) error { - var res TerminatorDetailLimited +func (m *TerminatorClientDetail) UnmarshalBinary(b []byte) error { + var res TerminatorClientDetail if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/rest_model/transit_router_list.go b/rest_model/terminator_client_list.go similarity index 67% rename from rest_model/transit_router_list.go rename to rest_model/terminator_client_list.go index 4ce98c0a5..de23bb68e 100644 --- a/rest_model/transit_router_list.go +++ b/rest_model/terminator_client_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -37,13 +38,13 @@ import ( "github.com/go-openapi/swag" ) -// TransitRouterList transit router list +// TerminatorClientList terminator client list // -// swagger:model transitRouterList -type TransitRouterList []*TransitRouterDetail +// swagger:model terminatorClientList +type TerminatorClientList []*TerminatorClientDetail -// Validate validates this transit router list -func (m TransitRouterList) Validate(formats strfmt.Registry) error { +// Validate validates this terminator client list +func (m TerminatorClientList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -67,3 +68,26 @@ func (m TransitRouterList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 487996600..357916440 100644 --- a/rest_model/terminator_cost.go +++ b/rest_model/terminator_cost.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -57,3 +59,8 @@ func (m TerminatorCost) Validate(formats strfmt.Registry) error { } 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 index 0b8e07bb2..279384270 100644 --- a/rest_model/terminator_cost_map.go +++ b/rest_model/terminator_cost_map.go @@ -30,14 +30,17 @@ package rest_model // 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 +type TerminatorCostMap map[string]*TerminatorCost // Validate validates this terminator cost map func (m TerminatorCostMap) Validate(formats strfmt.Registry) error { @@ -45,6 +48,9 @@ func (m TerminatorCostMap) Validate(formats strfmt.Registry) 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 @@ -58,3 +64,23 @@ func (m TerminatorCostMap) Validate(formats strfmt.Registry) error { } 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 index bc8a502b5..bd7f578de 100644 --- a/rest_model/terminator_create.go +++ b/rest_model/terminator_create.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -50,7 +52,7 @@ type TerminatorCreate struct { Binding *string `json:"binding"` // cost - Cost TerminatorCost `json:"cost,omitempty"` + Cost *TerminatorCost `json:"cost,omitempty"` // identity Identity string `json:"identity,omitempty"` @@ -131,23 +133,23 @@ func (m *TerminatorCreate) validateBinding(formats strfmt.Registry) error { } func (m *TerminatorCreate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required return nil } - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") + if m.Cost != nil { + if err := m.Cost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cost") + } + return err } - return err } return nil } func (m *TerminatorCreate) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required return nil } @@ -181,12 +183,73 @@ func (m *TerminatorCreate) validateService(formats strfmt.Registry) error { } func (m *TerminatorCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *TerminatorCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/terminator_detail.go b/rest_model/terminator_detail.go index f87b8dc8b..c09b38b5b 100644 --- a/rest_model/terminator_detail.go +++ b/rest_model/terminator_detail.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -52,11 +54,11 @@ type TerminatorDetail struct { // cost // Required: true - Cost TerminatorCost `json:"cost"` + Cost *TerminatorCost `json:"cost"` // dynamic cost // Required: true - DynamicCost TerminatorCost `json:"dynamicCost"` + DynamicCost *TerminatorCost `json:"dynamicCost"` // identity // Required: true @@ -64,7 +66,7 @@ type TerminatorDetail struct { // precedence // Required: true - Precedence TerminatorPrecedence `json:"precedence"` + Precedence *TerminatorPrecedence `json:"precedence"` // router // Required: true @@ -98,13 +100,13 @@ func (m *TerminatorDetail) UnmarshalJSON(raw []byte) error { Binding *string `json:"binding"` - Cost TerminatorCost `json:"cost"` + Cost *TerminatorCost `json:"cost"` - DynamicCost TerminatorCost `json:"dynamicCost"` + DynamicCost *TerminatorCost `json:"dynamicCost"` Identity *string `json:"identity"` - Precedence TerminatorPrecedence `json:"precedence"` + Precedence *TerminatorPrecedence `json:"precedence"` Router *EntityRef `json:"router"` @@ -155,13 +157,13 @@ func (m TerminatorDetail) MarshalJSON() ([]byte, error) { Binding *string `json:"binding"` - Cost TerminatorCost `json:"cost"` + Cost *TerminatorCost `json:"cost"` - DynamicCost TerminatorCost `json:"dynamicCost"` + DynamicCost *TerminatorCost `json:"dynamicCost"` Identity *string `json:"identity"` - Precedence TerminatorPrecedence `json:"precedence"` + Precedence *TerminatorPrecedence `json:"precedence"` Router *EntityRef `json:"router"` @@ -275,25 +277,45 @@ func (m *TerminatorDetail) validateBinding(formats strfmt.Registry) error { func (m *TerminatorDetail) validateCost(formats strfmt.Registry) error { - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } + 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") + } + return err + } + } + return nil } func (m *TerminatorDetail) validateDynamicCost(formats strfmt.Registry) error { - if err := m.DynamicCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dynamicCost") - } + 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") + } + return err + } + } + return nil } @@ -308,13 +330,23 @@ func (m *TerminatorDetail) validateIdentity(formats strfmt.Registry) error { func (m *TerminatorDetail) validatePrecedence(formats strfmt.Registry) error { - if err := m.Precedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } + 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") + } + return err + } + } + return nil } @@ -372,6 +404,111 @@ func (m *TerminatorDetail) validateServiceID(formats strfmt.Registry) error { 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") + } + 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") + } + 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") + } + 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") + } + 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") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *TerminatorDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/rest_model/terminator_list.go b/rest_model/terminator_list.go index 6780a813a..ca51e4329 100644 --- a/rest_model/terminator_list.go +++ b/rest_model/terminator_list.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -67,3 +68,26 @@ func (m TerminatorList) Validate(formats strfmt.Registry) error { } 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)) + } + 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 index 477bcca58..4545dcd0d 100644 --- a/rest_model/terminator_patch.go +++ b/rest_model/terminator_patch.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -47,7 +49,7 @@ type TerminatorPatch struct { Binding string `json:"binding,omitempty"` // cost - Cost TerminatorCost `json:"cost,omitempty"` + Cost *TerminatorCost `json:"cost,omitempty"` // precedence Precedence TerminatorPrecedence `json:"precedence,omitempty"` @@ -85,23 +87,23 @@ func (m *TerminatorPatch) Validate(formats strfmt.Registry) error { } func (m *TerminatorPatch) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required return nil } - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") + if m.Cost != nil { + if err := m.Cost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cost") + } + return err } - return err } return nil } func (m *TerminatorPatch) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required return nil } @@ -117,12 +119,73 @@ func (m *TerminatorPatch) validatePrecedence(formats strfmt.Registry) error { } func (m *TerminatorPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *TerminatorPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/terminator_precedence.go b/rest_model/terminator_precedence.go index cb876dfcb..37ad50267 100644 --- a/rest_model/terminator_precedence.go +++ b/rest_model/terminator_precedence.go @@ -30,6 +30,7 @@ package rest_model // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -42,6 +43,11 @@ import ( // swagger:model terminatorPrecedence type TerminatorPrecedence string +func NewTerminatorPrecedence(value TerminatorPrecedence) *TerminatorPrecedence { + v := value + return &v +} + const ( // TerminatorPrecedenceDefault captures enum value "default" @@ -88,3 +94,8 @@ func (m TerminatorPrecedence) Validate(formats strfmt.Registry) error { } 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 index 467a660b5..4595ded07 100644 --- a/rest_model/terminator_precedence_map.go +++ b/rest_model/terminator_precedence_map.go @@ -30,6 +30,8 @@ package rest_model // 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" ) @@ -58,3 +60,23 @@ func (m TerminatorPrecedenceMap) Validate(formats strfmt.Registry) error { } 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 index f6f17c8c1..3835c9adb 100644 --- a/rest_model/terminator_update.go +++ b/rest_model/terminator_update.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -50,7 +52,7 @@ type TerminatorUpdate struct { Binding *string `json:"binding"` // cost - Cost TerminatorCost `json:"cost,omitempty"` + Cost *TerminatorCost `json:"cost,omitempty"` // precedence Precedence TerminatorPrecedence `json:"precedence,omitempty"` @@ -124,23 +126,23 @@ func (m *TerminatorUpdate) validateBinding(formats strfmt.Registry) error { } func (m *TerminatorUpdate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required return nil } - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") + if m.Cost != nil { + if err := m.Cost.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cost") + } + return err } - return err } return nil } func (m *TerminatorUpdate) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required return nil } @@ -174,12 +176,73 @@ func (m *TerminatorUpdate) validateService(formats strfmt.Registry) error { } func (m *TerminatorUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required return nil } - if err := m.Tags.Validate(formats); err != nil { + if m.Tags != nil { + if err := m.Tags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.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") + } + 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") + } + return err + } + + return nil +} + +func (m *TerminatorUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Tags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tags") } diff --git a/rest_model/username.go b/rest_model/username.go index 7eda350f5..e53fe9146 100644 --- a/rest_model/username.go +++ b/rest_model/username.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -57,3 +59,8 @@ func (m Username) Validate(formats strfmt.Registry) error { } 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 index 35c4f0390..5077566ad 100644 --- a/rest_model/username_nullable.go +++ b/rest_model/username_nullable.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -37,7 +39,7 @@ import ( // UsernameNullable username nullable // -// swagger:model username-nullable +// swagger:model usernameNullable type UsernameNullable string // Validate validates this username nullable @@ -57,3 +59,8 @@ func (m UsernameNullable) Validate(formats strfmt.Registry) error { } 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 index cb5a59006..9f06497f7 100644 --- a/rest_model/version.go +++ b/rest_model/version.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -45,15 +47,19 @@ type Version struct { 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"` } @@ -72,7 +78,6 @@ func (m *Version) Validate(formats strfmt.Registry) error { } func (m *Version) validateAPIVersions(formats strfmt.Registry) error { - if swag.IsZero(m.APIVersions) { // not required return nil } @@ -97,6 +102,39 @@ func (m *Version) validateAPIVersions(formats strfmt.Registry) error { 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 { diff --git a/rest_model/version_info.go b/rest_model/version_info.go index 3cfa9e0bb..178bd8b27 100644 --- a/rest_model/version_info.go +++ b/rest_model/version_info.go @@ -30,6 +30,8 @@ package rest_model // 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" @@ -137,6 +139,11 @@ func (m *VersionInfo) validateVersion(formats strfmt.Registry) error { 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 { diff --git a/rest_server/operations/geo_region/detail_geo_region_parameters.go b/rest_server/operations/geo_region/detail_geo_region_parameters.go deleted file mode 100644 index 8f76ca471..000000000 --- a/rest_server/operations/geo_region/detail_geo_region_parameters.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 geo_region - -// This file was generated by 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" -) - -// NewDetailGeoRegionParams creates a new DetailGeoRegionParams object -// no default values defined in spec. -func NewDetailGeoRegionParams() DetailGeoRegionParams { - - return DetailGeoRegionParams{} -} - -// DetailGeoRegionParams contains all the bound params for the detail geo region operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailGeoRegion -type DetailGeoRegionParams 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 NewDetailGeoRegionParams() beforehand. -func (o *DetailGeoRegionParams) 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 *DetailGeoRegionParams) 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_server/operations/geo_region/detail_geo_region_responses.go b/rest_server/operations/geo_region/detail_geo_region_responses.go deleted file mode 100644 index 20502e3c1..000000000 --- a/rest_server/operations/geo_region/detail_geo_region_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 geo_region - -// This file was generated by 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" -) - -// DetailGeoRegionOKCode is the HTTP code returned for type DetailGeoRegionOK -const DetailGeoRegionOKCode int = 200 - -/*DetailGeoRegionOK A single geo-region - -swagger:response detailGeoRegionOK -*/ -type DetailGeoRegionOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailGeoRegionEnvelope `json:"body,omitempty"` -} - -// NewDetailGeoRegionOK creates DetailGeoRegionOK with default headers values -func NewDetailGeoRegionOK() *DetailGeoRegionOK { - - return &DetailGeoRegionOK{} -} - -// WithPayload adds the payload to the detail geo region o k response -func (o *DetailGeoRegionOK) WithPayload(payload *rest_model.DetailGeoRegionEnvelope) *DetailGeoRegionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail geo region o k response -func (o *DetailGeoRegionOK) SetPayload(payload *rest_model.DetailGeoRegionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailGeoRegionOK) 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 - } - } -} - -// DetailGeoRegionUnauthorizedCode is the HTTP code returned for type DetailGeoRegionUnauthorized -const DetailGeoRegionUnauthorizedCode int = 401 - -/*DetailGeoRegionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailGeoRegionUnauthorized -*/ -type DetailGeoRegionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailGeoRegionUnauthorized creates DetailGeoRegionUnauthorized with default headers values -func NewDetailGeoRegionUnauthorized() *DetailGeoRegionUnauthorized { - - return &DetailGeoRegionUnauthorized{} -} - -// WithPayload adds the payload to the detail geo region unauthorized response -func (o *DetailGeoRegionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailGeoRegionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail geo region unauthorized response -func (o *DetailGeoRegionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailGeoRegionUnauthorized) 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 - } - } -} - -// DetailGeoRegionNotFoundCode is the HTTP code returned for type DetailGeoRegionNotFound -const DetailGeoRegionNotFoundCode int = 404 - -/*DetailGeoRegionNotFound The requested resource does not exist - -swagger:response detailGeoRegionNotFound -*/ -type DetailGeoRegionNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailGeoRegionNotFound creates DetailGeoRegionNotFound with default headers values -func NewDetailGeoRegionNotFound() *DetailGeoRegionNotFound { - - return &DetailGeoRegionNotFound{} -} - -// WithPayload adds the payload to the detail geo region not found response -func (o *DetailGeoRegionNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailGeoRegionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail geo region not found response -func (o *DetailGeoRegionNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailGeoRegionNotFound) 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_server/operations/geo_region/detail_geo_region_urlbuilder.go b/rest_server/operations/geo_region/detail_geo_region_urlbuilder.go deleted file mode 100644 index 93bf4bbea..000000000 --- a/rest_server/operations/geo_region/detail_geo_region_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 geo_region - -// 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" -) - -// DetailGeoRegionURL generates an URL for the detail geo region operation -type DetailGeoRegionURL 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 *DetailGeoRegionURL) WithBasePath(bp string) *DetailGeoRegionURL { - 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 *DetailGeoRegionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailGeoRegionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/geo-regions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailGeoRegionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/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 *DetailGeoRegionURL) 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 *DetailGeoRegionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailGeoRegionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailGeoRegionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailGeoRegionURL") - } - - 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 *DetailGeoRegionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_server/operations/geo_region/list_geo_regions.go b/rest_server/operations/geo_region/list_geo_regions.go deleted file mode 100644 index 6cbff5370..000000000 --- a/rest_server/operations/geo_region/list_geo_regions.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 geo_region - -// 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" -) - -// ListGeoRegionsHandlerFunc turns a function with the right signature into a list geo regions handler -type ListGeoRegionsHandlerFunc func(ListGeoRegionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListGeoRegionsHandlerFunc) Handle(params ListGeoRegionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListGeoRegionsHandler interface for that can handle valid list geo regions params -type ListGeoRegionsHandler interface { - Handle(ListGeoRegionsParams, interface{}) middleware.Responder -} - -// NewListGeoRegions creates a new http.Handler for the list geo regions operation -func NewListGeoRegions(ctx *middleware.Context, handler ListGeoRegionsHandler) *ListGeoRegions { - return &ListGeoRegions{Context: ctx, Handler: handler} -} - -/*ListGeoRegions swagger:route GET /geo-regions Geo Region listGeoRegions - -List available geo-regions - -Retrieves a list of geo-regions; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListGeoRegions struct { - Context *middleware.Context - Handler ListGeoRegionsHandler -} - -func (o *ListGeoRegions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewListGeoRegionsParams() - - 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 - } - - 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/scripts/generate_rest.ps1 b/scripts/generate_rest.ps1 index 05b742ca0..49a3cc58d 100644 --- a/scripts/generate_rest.ps1 +++ b/scripts/generate_rest.ps1 @@ -1,6 +1,9 @@ $PSDefaultParameterValues += @{ 'New-RegKey:ErrorAction' = 'Stop' } + +$orignalLocaltion = Get-Location try { + Get-Command swagger -ErrorAction "SilentlyContinue" | Out-Null if (-not$?) { @@ -8,21 +11,58 @@ try } $zitiEdgeDir = Join-Path $PSScriptRoot "../" -Resolve + $zitiSpecSrcDir = Join-Path $PSScriptRoot "../specs/source" -Resolve $copyrightFile = Join-Path $PSScriptRoot "template.copyright.txt" -Resolve - $swagSpec = Join-Path $zitiEdgeDir "/specs/swagger.yml" -Resolve - "...reading spec from $swagSpec" + "...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." + } - $serverPath = Join-Path $zitiEdgeDir "/rest_server" - "...removing any existing server from $serverPath" - Remove-Item $serverPath -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $serverPath -ErrorAction "SilentlyContinue" | Out-Null + swagger flatten .\management.yml -o ..\management.yml --format yaml + if (-not$?) + { + Pop-Location + throw "Failed to flatten management.yml. See above." + } - $clientPath = Join-Path $zitiEdgeDir "/rest_client" - "...removing any existing client from $clientPath" - Remove-Item $clientPath -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $clientPath -ErrorAction "SilentlyContinue" | Out-Null + $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" @@ -30,14 +70,29 @@ try New-Item -ItemType "directory" -Path $modelPath -ErrorAction "SilentlyContinue" | Out-Null - "...generating server" - swagger generate server --exclude-main -f $swagSpec -s rest_server -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" + "...generating Client API server" + swagger generate server --exclude-main -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" - swagger generate client -f $swagSpec -c rest_client -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" + + "...generating Client API client" + swagger generate client -f $clientSpec -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 -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 -c rest_management_api_client -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" if (-not$?) { throw "Failed to generate client. See above." @@ -49,7 +104,22 @@ try # 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 $serverPath "/configure_ziti_edge.go" -Resolve + $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) @@ -68,4 +138,6 @@ try catch { [Console]::Error.WriteLine($Error[0]) -} \ No newline at end of file +} + +Set-Location $orignalLocaltion \ No newline at end of file diff --git a/scripts/generate_rest.sh b/scripts/generate_rest.sh index e01f3c4af..9e21e86e5 100755 --- a/scripts/generate_rest.sh +++ b/scripts/generate_rest.sh @@ -9,36 +9,83 @@ scriptPath=$(realpath $0) scriptDir=$(dirname "$scriptPath") zitiEdgeDir=$(realpath "$scriptDir/..") -swagSpec=$(realpath "$zitiEdgeDir/specs/swagger.yml") + +clientSourceSpec=$(realpath "$zitiEdgeDir/specs/source/client.yml") +clientSwagSpec=$(realpath "$zitiEdgeDir/specs/client.yml") + +managementSourceSpec=$(realpath "$zitiEdgeDir/specs/management.yml") +managementSwagSpec=$(realpath "$zitiEdgeDir/specs/management.yml") + copyrightFile=$(realpath "$scriptDir/template.copyright.txt") -serverPath=$(realpath "$zitiEdgeDir/rest_server") -echo "...removing any existing server from $serverPath" -rm -rf "$serverPath" -mkdir -p "$serverPath" +echo "...flattening client spec" +swagger flatten "$clientSourceSpec" -o "$clientSwagSpec" --format yaml +echo "...flattening management spec" +swagger flatten "$managementSourceSpec" -o "$managementSwagSpec" --format yaml -clientPath=$(realpath "$zitiEdgeDir/rest_client") -echo "...removing any existing client from $clientPath" -rm -rf "$clientPath" -mkdir -p "$clientPath" + +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 server" -swagger generate server --exclude-main -f "$swagSpec" -s rest_server -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" + +echo "...generating client api server" +swagger generate server --exclude-main -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 server. See above." + echo "Failed to generate client api server. See above." exit "${exit_status}" fi -echo "...generating client" -swagger generate client -f "$swagSpec" -c rest_client -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" +echo "...generating client api client" +swagger generate client -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. See above." + echo "Failed to generate client api client. See above." + exit "${exit_status}" +fi + +echo "...generating management api server" +swagger generate server --exclude-main -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 -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/specs/client.yml b/specs/client.yml new file mode 100644 index 000000000..48e6380d3 --- /dev/null +++ b/specs/client.yml @@ -0,0 +1,3742 @@ +consumes: +- application/json +produces: +- application/json +schemes: +- https +swagger: "2.0" +info: + title: Ziti Edge Client + contact: {} + version: 0.19.12 +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. + This endpoint returns a base64 encoded PKCS7 store. The content can be base64 decoded and parsed by any library + that supports parsing PKCS7 stores. + 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 + BjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw + FQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD + VQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl + IEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx + ODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI + DA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg + TmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv + dW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC + CgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z + KIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ + NJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa + VK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl + 7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s + 6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb + QGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010 + XdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU + He16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW + ghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb + ryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw + HQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu + OuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD + AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE + gRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS + Cpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7 + KOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+ + rMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X + 6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI + Fximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN + 8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw + BHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2 + YSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo + LLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq + dH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB + lzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH + DAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv + dW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5 + IFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG + A1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy + bG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg + Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg + Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD + DIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw + HDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f + WsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV + XO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv + pnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD + w2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI + KyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo + 783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm + pQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE + WFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F + 6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa + bADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD + VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB + ACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy + 3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY + uEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn + cCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS + WI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg + AX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO + wEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y + qQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m + fGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh + dprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8 + 3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA== + /authenticate: + post: + security: [] + description: | + Allows authentication Methods include "password" and "cert" + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + parameters: + - enum: + - password + - cert + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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' + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + delete: + security: + - ztSession: [] + description: | + Delete an ephemeral certificateby id + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + service refreshes. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + identity. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + session's identity. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + includes their address and online status + 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: + apiEnrolmentVersion: 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`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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` + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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//mfa`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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. + 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: + apiEnrolmentVersion: 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. + 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 + using its current and valid client certificate to submit a CSR. This CSR may + be pased 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. 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. + 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: + apiEnrolmentVersion: 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 + 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. + 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----- + MIICzDCCAlGgAwIBAgIRAPkVg1jVKqnNGFpSB3lPbaIwCgYIKoZIzj0EAwIwXjEL + MAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0w + KwYDVQQDDCROZXRGb3VuZHJ5IFppdGkgRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwHhcN + MTgxMTE1MTI1NzE3WhcNMTkxMTI1MTI1NzE3WjBrMQswCQYDVQQGEwJVUzELMAkG + A1UECAwCTkMxEjAQBgNVBAcMCUNoYXJsb3R0ZTETMBEGA1UECgwKTmV0Rm91bmRy + eTEPMA0GA1UECwwGQWR2RGV2MRUwEwYDVQQDDAxaaXRpQ2xpZW50MDEwdjAQBgcq + hkjOPQIBBgUrgQQAIgNiAATTl2ft+/K9RvDgki9gSr9udNcV2bxD4LrWEdCdXNzF + iVUiEcEte9z/M0JRt8lgo17OjFvS+ecrAmLtIZNmQnH3+9YeafjeNPpvQsMKxlTN + MnU7Hka11GHc6swQZSyHvlKjgcUwgcIwCQYDVR0TBAIwADARBglghkgBhvhCAQEE + BAMCBaAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2VuZXJhdGVkIENsaWVudCBD + ZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUtx+Tej6lSYdjb8Jbc2QuvoEsI/swHwYDVR0j + BBgwFoAUcdTlRrnP43ZbQ3PGAbZMPE26+H4wDgYDVR0PAQH/BAQDAgXgMB0GA1Ud + JQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAKBggqhkjOPQQDAgNpADBmAjEAuXDS + H7KKMr+la+Yuh8d8Q9cLtXzdS0j6a8e7iOyPJmdWq2WuzNdbCfAfLgKXuxhSAjEA + sadZrXl1OBv11RGAKdYBIyRmfYUotCFAtCNKcfgBUxci0TDaKDA7r3jnjKT1d7Fs + -----END CERTIFICATE----- + "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: + apiEnrolmentVersion: 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 + 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. + 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 + 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + parameters: + - type: string + format: uuid + name: token + in: query + required: true + /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: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + + 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + type: string + apiSessionDetail: + description: An API Session object + type: object + allOf: + - $ref: '#/definitions/baseEntity' + - type: object + required: + - token + - identity + - identityId + - configTypes + - ipAddress + - authQueries + - cachedUpdatedAt + - isMfaRequired + - isMfaComplete + properties: + authQueries: + $ref: '#/definitions/authQueryList' + 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: + 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-omitempty: false + 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 + - tags + properties: + _links: + $ref: '#/definitions/links' + createdAt: + type: string + format: date-time + id: + type: string + tags: + $ref: '#/definitions/tags' + updatedAt: + type: string + format: date-time + commonEdgeRouterProperties: + type: object + required: + - hostname + - name + - supportedProtocols + - syncStatus + - isOnline + properties: + appData: + $ref: '#/definitions/tags' + hostname: + type: string + isOnline: + type: boolean + name: + type: string + 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 + - error + properties: + error: + $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 + updb: + type: object + properties: + 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 + properties: + appData: + $ref: '#/definitions/tags' + authenticators: + $ref: '#/definitions/identityAuthenticators' + defaultHostingCost: + $ref: '#/definitions/terminatorCost' + defaultHostingPrecedence: + $ref: '#/definitions/terminatorPrecedence' + enrollment: + $ref: '#/definitions/identityEnrollments' + envInfo: + $ref: '#/definitions/envInfo' + 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 + 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' + 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: + apiEnrolmentVersion: + 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 + 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 + properties: + isPassing: + type: boolean + process: + $ref: '#/definitions/postureQueryProcess' + processes: + type: array + items: + $ref: '#/definitions/postureQueryProcess' + queryType: + $ref: '#/definitions/postureCheckType' + timeout: + type: integer + postureQueryProcess: + type: object + properties: + osType: + $ref: '#/definitions/osType' + path: + type: string + 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 + 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 + 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: + 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: + 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: + 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 + properties: + apiSession: + $ref: '#/definitions/entityRef' + apiSessionId: + type: string + edgeRouters: + type: array + items: + $ref: '#/definitions/sessionEdgeRouter' + 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' + tags: + description: 'A map of user defined fields and values. The values are limited + to the following types/values: null, string, boolean' + type: object + additionalProperties: + type: object + x-omitempty: false + 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/specs/management.yml b/specs/management.yml new file mode 100644 index 000000000..e704c485e --- /dev/null +++ b/specs/management.yml @@ -0,0 +1,13093 @@ +consumes: +- application/json +produces: +- application/json +schemes: +- https +swagger: "2.0" +info: + title: Ziti Edge Management + contact: {} + version: 0.19.12 +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 + requries admin access. + 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' + /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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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" + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + parameters: + - enum: + - password + - cert + 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. + This endpoint requries admin access. + tags: + - Authenticator + summary: List authenticators + operationId: listAuthenticators + responses: + "200": + description: A list of authenticators + schema: + $ref: '#/definitions/listAuthenticatorsEnvelope' + post: + security: + - ztSession: [] + description: | + Creates an authenticator for a specific identity. Requires admin access. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + Requires admin access. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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' + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + impossible for identities to authenticate if they no longer have any valid authenticators. Requires admin access. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + the jwt as a text response. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + identity. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + session's identity. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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` + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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//mfa`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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`. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + /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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 signle 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. | + 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + This data should be considered volatile. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + 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' + /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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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 + 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' + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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. + + 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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/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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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. + 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' + "401": + description: The currently supplied session does not have the correct access + rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + application/json: + error: + args: + urlVars: {} + cause: "" + causeMessage: "" + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized + or the credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + apiEnrolmentVersion: 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: + type: string + apiSessionDetail: + description: An API Session object + type: object + allOf: + - $ref: '#/definitions/baseEntity' + - type: object + required: + - token + - identity + - identityId + - configTypes + - ipAddress + - authQueries + - cachedUpdatedAt + - isMfaRequired + - isMfaComplete + properties: + authQueries: + $ref: '#/definitions/authQueryList' + 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: + mfa: + $ref: '#/definitions/postureDataMfa' + apiVersion: + type: object + required: + - path + properties: + 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-omitempty: false + 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: + - username + - password + - method + - identityId + properties: + 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 + - tags + 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----- + MIICUjCCAdmgAwIBAgIJANooo7NB+dZZMAoGCCqGSM49BAMCMF4xCzAJBgNVBAYT + AlVTMQswCQYDVQQIDAJOQzETMBEGA1UECgwKTmV0Rm91bmRyeTEtMCsGA1UEAwwk + TmV0Rm91bmRyeSBaaXRpIEV4dGVybmFsIEFQSSBSb290IENBMB4XDTE4MTExNTEy + NTcwOVoXDTM4MTExMDEyNTcwOVowXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5D + MRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0wKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkg + RXh0ZXJuYWwgQVBJIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARwq61Z + Iaqbaw0PDt3frJZaHjkxfZhwYrykI1GlbRNd/jix03lVG9qvpN5Og9fQfFFcFmD/ + 3vCE9S6O0npm0mADQxcBcxbMRAH5dtBuCuiJW6qAAbPgiM32vqSxBiFt0KejYzBh + MB0GA1UdDgQWBBRx1OVGuc/jdltDc8YBtkw8Tbr4fjAfBgNVHSMEGDAWgBRx1OVG + uc/jdltDc8YBtkw8Tbr4fjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB + hjAKBggqhkjOPQQDAgNnADBkAjBDRxNZUaIVpkQKnAgJukl3ysd3/i7Z6hDyIEms + kllz/+ZvmdBp9iedV5o5BvJUggACMCv+UBFlJH7pmsOCo/F45Kk178YsCC7gaMxE + 1ZG1zveyMvsYsH04C9FndE6w2MLvlA== + -----END CERTIFICATE----- + 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 + 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: + 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' + caUpdate: + type: object + required: + - name + - isAutoCaEnrollmentEnabled + - isOttCaEnrollmentEnabled + - isAuthEnabled + - identityRoles + properties: + 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 + properties: + appData: + $ref: '#/definitions/tags' + hostname: + type: string + isOnline: + type: boolean + name: + type: string + 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' + 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' + 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 + - error + properties: + error: + $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' + detailSessionEnvelope: + type: object + required: + - meta + - data + properties: + data: + $ref: '#/definitions/sessionDetail' + 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' + edgeRouterCreate: + description: An edge router create object + type: object + required: + - name + properties: + appData: + $ref: '#/definitions/tags' + isTunnelerEnabled: + type: boolean + name: + type: string + 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: + 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' + 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 + 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 + 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' + isTunnelerEnabled: + type: boolean + name: + type: string + roleAttributes: + $ref: '#/definitions/attributes' + tags: + $ref: '#/definitions/tags' + edgeRouterPolicyCreate: + required: + - name + 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 + 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' + isTunnelerEnabled: + type: boolean + name: + type: string + roleAttributes: + $ref: '#/definitions/attributes' + tags: + $ref: '#/definitions/tags' + empty: + type: object + required: + - meta + - data + properties: + data: + type: object + example: {} + meta: + $ref: '#/definitions/meta' + enrollmentDetail: + description: | + An enrollment object. Enrolments are tied to identities and portentially 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. + type: object + allOf: + - $ref: '#/definitions/baseEntity' + - type: object + required: + - token + - method + - expiresAt + - details + properties: + details: + type: object + additionalProperties: + type: string + edgeRouter: + $ref: '#/definitions/entityRef' + edgeRouterId: + type: string + expiresAt: + type: string + format: date-time + identity: + $ref: '#/definitions/entityRef' + identityId: + 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' + 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 + 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 + updb: + type: object + properties: + username: + type: string + identityCreate: + description: An identity to create + type: object + required: + - name + - type + - isAdmin + properties: + appData: + $ref: '#/definitions/tags' + defaultHostingCost: + $ref: '#/definitions/terminatorCost' + defaultHostingPrecedence: + $ref: '#/definitions/terminatorPrecedence' + enrollment: + type: object + properties: + ott: + type: boolean + ottca: + type: string + updb: + type: string + 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 + properties: + appData: + $ref: '#/definitions/tags' + authenticators: + $ref: '#/definitions/identityAuthenticators' + defaultHostingCost: + $ref: '#/definitions/terminatorCost' + defaultHostingPrecedence: + $ref: '#/definitions/terminatorPrecedence' + enrollment: + $ref: '#/definitions/identityEnrollments' + envInfo: + $ref: '#/definitions/envInfo' + 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 + identityList: + description: A list of identities + type: array + items: + $ref: '#/definitions/identityDetail' + identityPatch: + type: object + properties: + appData: + $ref: '#/definitions/tags' + defaultHostingCost: + $ref: '#/definitions/terminatorCost' + defaultHostingPrecedence: + $ref: '#/definitions/terminatorPrecedence' + 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' + 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' + defaultHostingCost: + $ref: '#/definitions/terminatorCost' + defaultHostingPrecedence: + $ref: '#/definitions/terminatorPrecedence' + 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' + 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' + 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' + 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' + 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: + apiEnrolmentVersion: + 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 + 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 + properties: + actualValue: + type: boolean + expectedValue: + type: boolean + 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' + x-class: MFA + postureCheckMfaDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + x-class: MFA + postureCheckMfaPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + x-class: MFA + postureCheckMfaUpdate: + allOf: + - $ref: '#/definitions/postureCheckUpdate' + 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 + properties: + name: + type: string + roleAttributes: + $ref: '#/definitions/attributes' + tags: + $ref: '#/definitions/tags' + 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 + 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 + 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 + properties: + apiSessionId: + type: string + passedMfa: + type: boolean + 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 + properties: + isPassing: + type: boolean + process: + $ref: '#/definitions/postureQueryProcess' + processes: + type: array + items: + $ref: '#/definitions/postureQueryProcess' + queryType: + $ref: '#/definitions/postureCheckType' + timeout: + 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 + 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: + name: + type: string + tags: + $ref: '#/definitions/tags' + routerDetail: + type: object + allOf: + - $ref: '#/definitions/baseEntity' + - type: object + required: + - name + - isVerified + - isOnline + - fingerprint + properties: + 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 + 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: + name: + type: string + tags: + $ref: '#/definitions/tags' + routerUpdate: + type: object + required: + - name + properties: + name: + type: string + 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: + 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: + 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 + 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 + 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: + type: boolean + name: + type: string + roleAttributes: + type: array + items: + type: string + tags: + $ref: '#/definitions/tags' + terminatorStrategy: + type: string + servicePolicyCreate: + type: object + required: + - name + - type + 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 + 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: + 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 + properties: + apiSession: + $ref: '#/definitions/entityRef' + apiSessionId: + type: string + edgeRouters: + type: array + items: + $ref: '#/definitions/sessionEdgeRouter' + 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' + 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' + tags: + description: 'A map of user defined fields and values. The values are limited + to the following types/values: null, string, boolean' + type: object + additionalProperties: + type: object + x-omitempty: false + 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' + 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/specs/source/client.yml b/specs/source/client.yml new file mode 100644 index 000000000..e9e3c4710 --- /dev/null +++ b/specs/source/client.yml @@ -0,0 +1,115 @@ +--- +swagger: '2.0' +info: + version: 0.19.12 + title: Ziti Edge Client + contact: { } +host: demo.ziti.dev +basePath: /edge/client/v1 +schemes: + - https +consumes: + - application/json +produces: + - application/json +securityDefinitions: + ztSession: + type: apiKey + in: header + name: zt-session + description: An API Key that is provided post authentication + +paths: + '/': + $ref: 'shared/version.yml#/paths/root' + + '/.well-known/est/cacerts': + $ref: 'client/well-known.yml#/paths/well-known-est-cacerts' + + '/authenticate': + $ref: 'shared/authenticate.yml#/paths/authenticate' + '/authenticate/mfa': + $ref: 'shared/authenticate.yml#/paths/authenticate-mfa' + + '/current-api-session': + $ref: 'shared/current-api-session.yml#/paths/current-api-session' + '/current-api-session/certificates': + $ref: 'client/current-api-session-certificates.yml#/paths/current-api-session-certificates' + '/current-api-session/certificates/{id}': + $ref: 'client/current-api-session-certificates.yml#/paths/current-api-session-certificates-id' + '/current-api-session/service-updates': + $ref: 'client/current-api-session-service-updates.yml#/paths/current-api-session-service-updates' + + '/current-identity': + $ref: 'shared/current-identity.yml#/paths/current-identity' + '/current-identity/authenticators': + $ref: 'shared/current-identity-authenticators.yml#/paths/current-identity-authenticators' + '/current-identity/authenticators/{id}': + $ref: 'shared/current-identity-authenticators.yml#/paths/current-identity-authenticators-id' + '/current-identity/edge-routers': + $ref: 'client/current-identity-edge-routers.yml#/paths/current-identity-edge-routers' + '/current-identity/mfa': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa' + '/current-identity/mfa/qr-code': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-qr-code' + '/current-identity/mfa/verify': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-verify' + '/current-identity/mfa/recovery-codes': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-recovery-codes' + + '/enroll': + $ref: 'client/enroll.yml#/paths/enroll' + '/enroll/ca': + $ref: 'client/enroll.yml#/paths/enroll-ca' + '/enroll/ott': + $ref: 'client/enroll.yml#/paths/enroll-ott' + '/enroll/ottca': + $ref: 'client/enroll.yml#/paths/enroll-ottca' + '/enroll/updb': + $ref: 'client/enroll.yml#/paths/enroll-updb' + '/enroll/erott': + $ref: 'client/enroll.yml#/paths/enroll-erott' + '/enroll/extend/router': + $ref: 'client/enroll.yml#/paths/enroll-extend-router' + + '/posture-response': + $ref: 'client/posture-response.yml#/paths/posture-response' + '/posture-response-bulk': + $ref: 'client/posture-response.yml#/paths/posture-response-bulk' + + '/protocols': + $ref: 'client/protocols.yml#/paths/protocols' + + '/services': + $ref: 'client/services.yml#/paths/services' + '/services/{id}': + $ref: 'management/services.yml#/paths/services-id' + '/services/{id}/terminators': + $ref: 'client/services.yml#/paths/services-id-terminators' + + '/sessions': + $ref: 'client/sessions.yml#/paths/sessions' + '/sessions/{id}': + $ref: 'client/sessions.yml#/paths/sessions-id' + + '/specs': + $ref: 'shared/specs.yml#/paths/specs' + '/specs/{id}': + $ref: 'shared/specs.yml#/paths/specs-id' + '/specs/{id}/spec': + $ref: 'shared/specs.yml#/paths/specs-id-spec' + + '/version': + $ref: 'shared/version.yml#/paths/version' + +definitions: + # Polymorphic types are aren't explicitly used anywhere except here. Removal will cause them to be trimmed + + postureResponseOperatingSystemCreate: + $ref: 'client/posture-response.yml#/definitions/postureResponseOperatingSystemCreate' + postureResponseDomainCreate: + $ref: 'client/posture-response.yml#/definitions/postureResponseDomainCreate' + postureResponseMacAddressCreate: + $ref: 'client/posture-response.yml#/definitions/postureResponseMacAddressCreate' + postureResponseProcessCreate: + $ref: 'client/posture-response.yml#/definitions/postureResponseProcessCreate' \ No newline at end of file diff --git a/specs/source/client/current-api-session-certificates.yml b/specs/source/client/current-api-session-certificates.yml new file mode 100644 index 000000000..5952808a2 --- /dev/null +++ b/specs/source/client/current-api-session-certificates.yml @@ -0,0 +1,165 @@ +--- +paths: + current-api-session-certificates: + get: + summary: List the ephemeral certificates available for the current API Session + description: Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: listCurrentApiSessionCertificates + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listCurrentApiSessionCertificates' + post: + summary: Creates an ephemeral certificate for the current API Session + 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. + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: createCurrentApiSessionCertificate + parameters: + - name: sessionCertificate + in: body + required: true + description: The payload describing the CSR used to create a session certificate + schema: + $ref: '#/definitions/currentApiSessionCertificateCreate' + responses: + '201': + $ref: '#/responses/createCurrentApiSessionCertificateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + current-api-session-certificates-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves an ephemeral certificate + description: Retrieves a single ephemeral certificate by id + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: detailCurrentApiSessionCertificate + responses: + '200': + $ref: '#/responses/detailCurrentApiSessionCertificate' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an ephemeral certificate + description: | + Delete an ephemeral certificateby id + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: deleteCurrentApiSessionCertificate + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listCurrentApiSessionCertificates: + description: A list of the current API Session's certificate + schema: + $ref: '#/definitions/listCurrentAPISessionCertificatesEnvelope' + createCurrentApiSessionCertificateResponse: + description: A response of a create API Session certificate + schema: + $ref: '#/definitions/createCurrentApiSessionCertificateEnvelope' + detailCurrentApiSessionCertificate: + description: A response containing a single API Session certificate + schema: + $ref: '#/definitions/detailCurrentApiSessionCertificateEnvelope' + +definitions: + listCurrentAPISessionCertificatesEnvelope: + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/currentApiSessionCertificateList' + createCurrentApiSessionCertificateEnvelope: + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/currentApiSessionCertificateCreateResponse' + detailCurrentApiSessionCertificateEnvelope: + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/currentApiSessionCertificateDetail' + currentApiSessionCertificateList: + type: array + items: + $ref: '#/definitions/currentApiSessionCertificateDetail' + currentApiSessionCertificateDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - subject + - fingerprint + - validFrom + - validTo + - certificate + properties: + subject: + type: string + fingerprint: + type: string + validFrom: + type: string + format: date-time + validTo: + type: string + format: date-time + certificate: + type: string + currentApiSessionCertificateCreate: + type: object + required: + - csr + properties: + csr: + type: string + currentApiSessionCertificateCreateResponse: + allOf: + - $ref: '../shared/standard-responses.yml#/definitions/createLocation' + - type: object + required: + - certificate + properties: + certificate: + type: string + cas: + type: string diff --git a/specs/source/client/current-api-session-service-updates.yml b/specs/source/client/current-api-session-service-updates.yml new file mode 100644 index 000000000..42ff842a3 --- /dev/null +++ b/specs/source/client/current-api-session-service-updates.yml @@ -0,0 +1,45 @@ +--- +paths: + current-api-session-service-updates: + get: + summary: Returns data indicating whether a client should updates it service list + description: | + Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate + service refreshes. + security: + - ztSession: [ ] + tags: + - Current API Session + - Services + operationId: listServiceUpdates + responses: + '200': + $ref: '#/responses/listCurrentApiSessionServiceUpdates' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listCurrentApiSessionServiceUpdates: + description: Data indicating necessary service updates + schema: + $ref: '#/definitions/listCurrentApiSessionServiceUpdatesEnvelope' + +definitions: + listCurrentApiSessionServiceUpdatesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/CurrentApiSessionServiceUpdateList' + CurrentApiSessionServiceUpdateList: + type: object + required: + - lastChangeAt + properties: + lastChangeAt: + type: string + format: 'date-time' \ No newline at end of file diff --git a/specs/source/client/current-identity-edge-routers.yml b/specs/source/client/current-identity-edge-routers.yml new file mode 100644 index 000000000..8d883d503 --- /dev/null +++ b/specs/source/client/current-identity-edge-routers.yml @@ -0,0 +1,49 @@ +--- +paths: + current-identity-edge-routers: + get: + summary: Return this list of Edge Routers the identity has access to + description: | + Lists the Edge Routers that the current identity has access to via policies. The data returned + includes their address and online status + security: + - ztSession: [ ] + tags: + - Current Identity + - Edge Router + operationId: getCurrentIdentityEdgeRouters + responses: + '200': + $ref: '#/responses/listCurrentIdentityEdgeRouters' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listCurrentIdentityEdgeRouters: + description: A list of edge routers + schema: + $ref: '#/definitions/listCurrentIdentityEdgeRoutersEnvelope' + +definitions: + listCurrentIdentityEdgeRoutersEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/currentIdentityEdgeRouterList' + + currentIdentityEdgeRouterList: + description: A list of edge router resources + type: array + items: + $ref: '#/definitions/currentIdentityEdgeRouterDetail' + currentIdentityEdgeRouterDetail: + description: A detail edge router resource + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - $ref: '../shared/edge-routers.yml#/definitions/commonEdgeRouterProperties' \ No newline at end of file diff --git a/specs/source/client/enroll.yml b/specs/source/client/enroll.yml new file mode 100644 index 000000000..cb304114e --- /dev/null +++ b/specs/source/client/enroll.yml @@ -0,0 +1,201 @@ +--- +paths: + enroll: + parameters: + - $ref: '../shared/parameters.yml#/token-optional' + post: + summary: Legacy enrollment endpoint + description: endpoint defers to the logic in the more specific `enroll/*` endpoints + operationId: enroll + tags: + - Enroll + consumes: + - application/pkcs10 + - application/json + - application/x-pem-file + - text/plain + produces: + #default to PEM for older clients that do not properly set/inspect accept/content-type headers + - application/x-pem-file + - application/json + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + enroll-ca: + post: + summary: Enroll an identity with a pre-exchanged certificate + description: | + 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. + operationId: enrollCa + tags: + - Enroll + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + enroll-ott: + parameters: + - $ref: '../shared/parameters.yml#/token' + post: + summary: Enroll an identity via one-time-token + description: | + 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. + operationId: enrollOtt + tags: + - Enroll + consumes: + - application/pkcs10 + produces: + - application/x-x509-user-cert + responses: + '200': + $ref: '#/responses/zitiSignedCert' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + enroll-ottca: + parameters: + - $ref: '../shared/parameters.yml#/token' + post: + summary: Enroll an identity via one-time-token with a pre-exchanged client certificate + description: | + 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. + operationId: enrollOttCa + tags: + - Enroll + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + enroll-updb: + parameters: + - $ref: '../shared/parameters.yml#/token' + post: + summary: Enroll an identity via one-time-token + description: | + Enrolls an identity via a one-time-token to establish an initial username and password combination + operationId: ernollUpdb + tags: + - Enroll + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + enroll-erott: + parameters: + - $ref: '../shared/parameters.yml#/token' + post: + summary: Enroll an edge-router + description: | + Enrolls an edge-router via a one-time-token to establish a certificate based identity. + operationId: enrollErOtt + tags: + - Enroll + responses: + '200': + $ref: '#/responses/erottResponse' + enroll-extend-router: + post: + summary: Extend the life of a currently enrolled router's certificates + description: | + 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 pased 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. 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. + operationId: extendRouterEnrollment + parameters: + - name: routerExtendEnrollmentRequest + in: body + required: true + schema: + $ref: '#/definitions/routerExtendEnrollmentRequest' + tags: + - Enroll + - Extend Enrollment + responses: + '200': + $ref: '#/responses/routerExtendEnrollmentResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + erottResponse: + description: A response containing the edge routers signed certificates (server chain, server cert, CAs). + schema: + $ref: '#/definitions/enrollmentCertsEnvelope' + routerExtendEnrollmentResponse: + description: A response containg the edge routers new signed certificates (server chain, server cert, CAs). + schema: + $ref: '#/definitions/enrollmentCertsEnvelope' + zitiSignedCert: + description: A PEM encoded certificate signed by the internal Ziti CA + schema: + type: string + examples: + application/x-x509-user-cert: | + -----BEGIN CERTIFICATE----- + MIICzDCCAlGgAwIBAgIRAPkVg1jVKqnNGFpSB3lPbaIwCgYIKoZIzj0EAwIwXjEL + MAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0w + KwYDVQQDDCROZXRGb3VuZHJ5IFppdGkgRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwHhcN + MTgxMTE1MTI1NzE3WhcNMTkxMTI1MTI1NzE3WjBrMQswCQYDVQQGEwJVUzELMAkG + A1UECAwCTkMxEjAQBgNVBAcMCUNoYXJsb3R0ZTETMBEGA1UECgwKTmV0Rm91bmRy + eTEPMA0GA1UECwwGQWR2RGV2MRUwEwYDVQQDDAxaaXRpQ2xpZW50MDEwdjAQBgcq + hkjOPQIBBgUrgQQAIgNiAATTl2ft+/K9RvDgki9gSr9udNcV2bxD4LrWEdCdXNzF + iVUiEcEte9z/M0JRt8lgo17OjFvS+ecrAmLtIZNmQnH3+9YeafjeNPpvQsMKxlTN + MnU7Hka11GHc6swQZSyHvlKjgcUwgcIwCQYDVR0TBAIwADARBglghkgBhvhCAQEE + BAMCBaAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2VuZXJhdGVkIENsaWVudCBD + ZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUtx+Tej6lSYdjb8Jbc2QuvoEsI/swHwYDVR0j + BBgwFoAUcdTlRrnP43ZbQ3PGAbZMPE26+H4wDgYDVR0PAQH/BAQDAgXgMB0GA1Ud + JQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAKBggqhkjOPQQDAgNpADBmAjEAuXDS + H7KKMr+la+Yuh8d8Q9cLtXzdS0j6a8e7iOyPJmdWq2WuzNdbCfAfLgKXuxhSAjEA + sadZrXl1OBv11RGAKdYBIyRmfYUotCFAtCNKcfgBUxci0TDaKDA7r3jnjKT1d7Fs + -----END CERTIFICATE----- + +definitions: + enrollmentCertsEnvelope: + type: object + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/enrollmentCerts' + enrollmentCerts: + type: object + properties: + serverCert: + type: string + description: A PEM encoded set of certificates to use as the servers chain + cert: + type: string + description: A PEM encoded cert for the server + ca: + type: string + description: A PEM encoded set of CA certificates to trust + routerExtendEnrollmentRequest: + type: object + required: + - serverCertCsr + - certCsr + properties: + serverCertCsr: + type: string + certCsr: + type: string diff --git a/specs/source/client/posture-response.yml b/specs/source/client/posture-response.yml new file mode 100644 index 000000000..9d2d94e4d --- /dev/null +++ b/specs/source/client/posture-response.yml @@ -0,0 +1,124 @@ +--- +paths: + posture-response: + post: + summary: Submit a posture response to a posture query + description: Submits posture responses + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: createPostureResponse + parameters: + - name: postureResponse + in: body + required: true + description: A Posture Response + schema: + $ref: '#/definitions/postureResponseCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + posture-response-bulk: + post: + summary: Submit multiple posture responses + description: Submits posture responses + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: createPostureResponseBulk + parameters: + - name: postureResponse + in: body + required: true + description: A Posture Response + schema: + # using a named array definition causes issues w/ code gen + type: array + items: + $ref: "#/definitions/postureResponseCreate" + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' +responses: + +definitions: + postureResponseCreate: + type: object + discriminator: typeId + required: + - id + - typeId + properties: + id: + type: string + typeId: + $ref: '../shared/posture-checks.yml#/definitions/postureCheckType' + + postureResponseOperatingSystemCreate: + allOf: + - $ref: '#/definitions/postureResponseCreate' + - type: object + required: + - type + - version + properties: + type: + type: string + version: + type: string + build: + type: string + x-class: "OS" + + postureResponseDomainCreate: + allOf: + - $ref: '#/definitions/postureResponseCreate' + - type: object + required: + - domain + properties: + domain: + type: string + x-class: "DOMAIN" + + postureResponseMacAddressCreate: + allOf: + - $ref: '#/definitions/postureResponseCreate' + - type: object + required: + - macAddresses + properties: + macAddresses: + type: array + items: + type: string + x-class: "MAC" + + postureResponseProcessCreate: + allOf: + - $ref: '#/definitions/postureResponseCreate' + - type: object + required: + - process + properties: + path: + type: string + isRunning: + type: boolean + hash: + type: string + signerFingerprints: + type: array + items: + type: string + x-class: "PROCESS" \ No newline at end of file diff --git a/specs/source/client/protocols.yml b/specs/source/client/protocols.yml new file mode 100644 index 000000000..91e2a7cd6 --- /dev/null +++ b/specs/source/client/protocols.yml @@ -0,0 +1,41 @@ +--- +paths: + protocols: + get: + summary: Return a list of the listening Edge protocols + security: [ ] + tags: + - Informational + operationId: listProtocols + responses: + '200': + $ref: '#/responses/listProtocols' + +responses: + listProtocols: + description: A list of supported Edge protocols + schema: + $ref: '#/definitions/listProtocolsEnvelope' + +definitions: + listProtocolsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/listProtocols' + listProtocols: + type: object + additionalProperties: + $ref: '#/definitions/protocol' + protocol: + type: object + required: + - address + properties: + address: + type: string \ No newline at end of file diff --git a/specs/source/client/services.yml b/specs/source/client/services.yml new file mode 100644 index 000000000..d4adbbbda --- /dev/null +++ b/specs/source/client/services.yml @@ -0,0 +1,104 @@ +--- +paths: + services: + get: + summary: List services + description: | + Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServices + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + - $ref: '../shared/parameters.yml#/roleFilter' + - $ref: '../shared/parameters.yml#/roleSemantic' + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + services-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single service + description: Retrieves a single service by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: detailService + responses: + '200': + $ref: '../shared/services.yml#/responses/detailService' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + services-id-terminators: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List of terminators assigned to a service + description: | + Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceTerminators + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listClientTerminators' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listClientTerminators: + description: A list of terminators + schema: + $ref: '#/definitions/listClientTerminatorsEnvelope' + +definitions: + listClientTerminatorsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/terminatorClientList' + terminatorClientList: + type: array + items: + $ref: '#/definitions/terminatorClientDetail' + terminatorClientDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - serviceId + - service + - routerId + - identity + properties: + serviceId: + type: string + service: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + routerId: + type: string + identity: + type: string \ No newline at end of file diff --git a/specs/source/client/sessions.yml b/specs/source/client/sessions.yml new file mode 100644 index 000000000..42cf166ee --- /dev/null +++ b/specs/source/client/sessions.yml @@ -0,0 +1,105 @@ +--- +paths: + sessions: + get: + summary: List sessions + description: | + 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. + security: + - ztSession: [ ] + tags: + - Session + operationId: listSessions + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '../shared/sessions.yml#/responses/listSessions' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a session resource + description: Create a session resource. + security: + - ztSession: [ ] + tags: + - Session + operationId: createSession + parameters: + - name: session + in: body + required: true + description: A session to create + schema: + $ref: '#/definitions/sessionCreate' + responses: + '201': + $ref: '#/responses/sessionCreateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + sessions-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single session + description: Retrieves a single session by id. + security: + - ztSession: [ ] + tags: + - Session + operationId: detailSession + responses: + '200': + $ref: '../shared/sessions.yml#/responses/detailSession' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a session + description: Delete a session by id. + security: + - ztSession: [ ] + tags: + - Session + operationId: deleteSession + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + +responses: + sessionCreateResponse: + description: The create request was successful and the resource has been added at the following location + schema: + $ref: '#/definitions/sessionCreateEnvelope' + +definitions: + sessionCreateEnvelope: + type: object + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '../shared/sessions.yml#/definitions/sessionDetail' + sessionCreate: + type: object + properties: + serviceId: + type: string + type: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/client/well-known.yml b/specs/source/client/well-known.yml new file mode 100644 index 000000000..51ca1c984 --- /dev/null +++ b/specs/source/client/well-known.yml @@ -0,0 +1,87 @@ +--- +paths: + well-known-est-cacerts: + get: + summary: Get CA Cert Store + description: | + 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. + security: [ ] + tags: + - Well Known + operationId: listWellKnownCas + produces: + - application/pkcs7-mime + responses: + '200': + description: A base64 encoded PKCS7 store + schema: + type: string + example: | + MIIMUQYJKoZIhvcNAQcCoIIMQjCCDD4CAQExADALBgkqhkiG9w0BBwGgggwkMIIG + BjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw + FQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD + VQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl + IEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx + ODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI + DA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg + TmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv + dW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC + CgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z + KIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ + NJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa + VK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl + 7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s + 6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb + QGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010 + XdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU + He16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW + ghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb + ryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw + HQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu + OuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD + AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE + gRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS + Cpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7 + KOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+ + rMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X + 6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI + Fximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN + 8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw + BHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2 + YSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo + LLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq + dH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB + lzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH + DAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv + dW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5 + IFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG + A1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy + bG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg + Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg + Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD + DIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw + HDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f + WsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV + XO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv + pnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD + w2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI + KyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo + 783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm + pQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE + WFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F + 6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa + bADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD + VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB + ACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy + 3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY + uEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn + cCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS + WI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg + AX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO + wEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y + qQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m + fGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh + dprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8 + 3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA== diff --git a/specs/source/management.yml b/specs/source/management.yml new file mode 100644 index 000000000..808a5b218 --- /dev/null +++ b/specs/source/management.yml @@ -0,0 +1,307 @@ +--- +swagger: '2.0' +info: + version: 0.19.12 + title: Ziti Edge Management + contact: { } +host: demo.ziti.dev +basePath: /edge/management/v1 +schemes: + - https +consumes: + - application/json +produces: + - application/json +securityDefinitions: + ztSession: + type: apiKey + in: header + name: zt-session + description: An API Key that is provided post authentication + +paths: + '/': + $ref: 'shared/version.yml#/paths/root' + + '/api-sessions': + $ref: 'management/api-sessions.yml#/paths/api-sessions' + '/api-sessions/{id}': + $ref: 'management/api-sessions.yml#/paths/api-sessions-id' + + '/authenticate': + $ref: 'shared/authenticate.yml#/paths/authenticate' + '/authenticate/mfa': + $ref: 'shared/authenticate.yml#/paths/authenticate-mfa' + + '/authenticators': + $ref: 'management/authenticators.yml#/paths/authenticators' + '/authenticators/{id}': + $ref: 'management/authenticators.yml#/paths/authenticators-id' + + '/cas': + $ref: 'management/cas.yml#/paths/cas' + '/cas/{id}': + $ref: 'management/cas.yml#/paths/cas-id' + '/cas/{id}/jwt': + $ref: 'management/cas.yml#/paths/cas-id-jwt' + '/cas/{id}/verify': + $ref: 'management/cas.yml#/paths/cas-id-verify' + + '/config-types': + $ref: 'management/config-types.yml#/paths/config-types' + '/config-types/{id}': + $ref: 'management/config-types.yml#/paths/config-types-id' + '/config-types/{id}/configs': + $ref: 'management/config-types.yml#/paths/config-types-id-configs' + + '/configs': + $ref: 'management/configs.yml#/paths/configs' + '/configs/{id}': + $ref: 'management/configs.yml#/paths/configs-id' + + '/current-api-session': + $ref: 'shared/current-api-session.yml#/paths/current-api-session' + + '/current-identity': + $ref: 'shared/current-identity.yml#/paths/current-identity' + '/current-identity/authenticators': + $ref: 'shared/current-identity-authenticators.yml#/paths/current-identity-authenticators' + '/current-identity/authenticators/{id}': + $ref: 'shared/current-identity-authenticators.yml#/paths/current-identity-authenticators-id' + '/current-identity/mfa': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa' + '/current-identity/mfa/qr-code': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-qr-code' + '/current-identity/mfa/verify': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-verify' + '/current-identity/mfa/recovery-codes': + $ref: 'shared/current-identity-mfa.yml#/paths/current-identity-mfa-recovery-codes' + + '/database/snapshot': + $ref: 'management/database.yml#/paths/database-snapshot' + /database/check-data-integrity: + $ref: 'management/database.yml#/paths/database-check-data-integrity' + /database/fix-data-integrity: + $ref: 'management/database.yml#/paths/database-fix-data-integrity' + /database/data-integrity-results: + $ref: 'management/database.yml#/paths/database-data-integrity-results' + + '/edge-router-role-attributes': + $ref: 'management/role-attributes.yml#/paths/edge-router-role-attributes' + + '/edge-routers': + $ref: 'management/edge-routers.yml#/paths/edge-routers' + '/edge-routers/{id}': + $ref: 'management/edge-routers.yml#/paths/edge-routers-id' + '/edge-routers/{id}/edge-router-policies': + $ref: 'management/edge-routers.yml#/paths/edge-routers-id-edge-router-policies' + '/edge-routers/{id}/identities': + $ref: 'management/edge-routers.yml#/paths/edge-routers-id-identities' + '/edge-routers/{id}/service-edge-router-policies': + $ref: 'management/edge-routers.yml#/paths/edge-routers-id-service-edge-router-policies' + '/edge-routers/{id}/services': + $ref: 'management/edge-routers.yml#/paths/edge-routers-id-services' + + '/edge-router-policies': + $ref: 'management/edge-router-policies.yml#/paths/edge-router-policies' + '/edge-router-policies/{id}': + $ref: 'management/edge-router-policies.yml#/paths/edge-router-policies-id' + '/edge-router-policies/{id}/edge-routers': + $ref: 'management/edge-router-policies.yml#/paths/edge-router-policies-id-edge-routers' + '/edge-router-policies/{id}/identities': + $ref: 'management/edge-router-policies.yml#/paths/edge-router-policies-id-identities' + + '/enrollments': + $ref: 'management/enrollments.yml#/paths/enrollments' + '/enrollments/{id}': + $ref: 'management/enrollments.yml#/paths/enrollments-id' + + '/identities': + $ref: 'management/identities.yml#/paths/identities' + '/identities/{id}': + $ref: 'management/identities.yml#/paths/identities-id' + '/identities/{id}/edge-router-policies': + $ref: 'management/identities.yml#/paths/identities-id-edge-router-policies' + '/identities/{id}/service-configs': + $ref: 'management/identities.yml#/paths/identities-id-service-configs' + '/identities/{id}/service-policies': + $ref: 'management/identities.yml#/paths/identities-id-service-policies' + '/identities/{id}/edge-routers': + $ref: 'management/identities.yml#/paths/identities-id-edge-routers' + '/identities/{id}/services': + $ref: 'management/identities.yml#/paths/identities-id-services' + '/identities/{id}/policy-advice/{serviceId}': + $ref: 'management/identities.yml#/paths/identities-id-policy-advice-service-id' + '/identities/{id}/posture-data': + $ref: 'management/identities.yml#/paths/identities-id-posture-data' + '/identities/{id}/failed-service-requests': + $ref: 'management/identities.yml#/paths/identities-id-failed-service-requests' + '/identities/{id}/mfa': + $ref: 'management/identities.yml#/paths/identities-id-mfa' + + '/identity-role-attributes': + $ref: 'management/role-attributes.yml#/paths/identity-role-attributes' + + '/identity-types': + $ref: 'management/identity-types.yml#/paths/identity-types' + '/identity-types/{id}': + $ref: 'management/identity-types.yml#/paths/identity-types-id' + + '/posture-checks': + $ref: 'management/posture-checks.yml#/paths/posture-checks' + '/posture-checks/{id}': + $ref: 'management/posture-checks.yml#/paths/posture-checks-id' + + '/posture-check-types': + $ref: 'management/posture-check-types.yml#/paths/posture-check-types' + '/posture-check-types/{id}': + $ref: 'management/posture-check-types.yml#/paths/posture-check-types-id' + + '/service-edge-router-policies': + $ref: 'management/service-edge-router-policies.yml#/paths/service-edge-router-policies' + '/service-edge-router-policies/{id}': + $ref: 'management/service-edge-router-policies.yml#/paths/service-edge-router-policies-id' + '/service-edge-router-policies/{id}/edge-routers': + $ref: 'management/service-edge-router-policies.yml#/paths/service-edge-router-policies-id-edge-routers' + '/service-edge-router-policies/{id}/services': + $ref: 'management/service-edge-router-policies.yml#/paths/service-edge-router-policies-id-services' + + '/service-role-attributes': + $ref: 'management/role-attributes.yml#/paths/service-role-attributes' + + '/service-policies': + $ref: 'management/service-policies.yml#/paths/service-policies' + '/service-policies/{id}': + $ref: 'management/service-policies.yml#/paths/service-policies-id' + '/service-policies/{id}/identities': + $ref: 'management/service-policies.yml#/paths/service-policies-id-identities' + '/service-policies/{id}/services': + $ref: 'management/service-policies.yml#/paths/service-policies-id-services' + '/service-policies/{id}/posture-checks': + $ref: 'management/service-policies.yml#/paths/service-policies-id-posture-checks' + + '/services': + $ref: 'management/services.yml#/paths/services' + '/services/{id}': + $ref: 'management/services.yml#/paths/services-id' + '/services/{id}/configs': + $ref: 'management/services.yml#/paths/services-id-configs' + '/services/{id}/service-edge-router-policies': + $ref: 'management/services.yml#/paths/services-id-service-edge-router-policies' + '/services/{id}/service-policies': + $ref: 'management/services.yml#/paths/services-id-service-policies' + '/services/{id}/identities': + $ref: 'management/services.yml#/paths/services-id-identities' + '/services/{id}/edge-routers': + $ref: 'management/services.yml#/paths/services-id-edge-routers' + '/services/{id}/terminators': + $ref: 'management/services.yml#/paths/services-id-terminators' + + '/sessions': + $ref: 'management/sessions.yml#/paths/sessions' + '/sessions/{id}': + $ref: 'management/sessions.yml#/paths/sessions-id' + '/sessions/{id}/route-path': + $ref: 'management/sessions.yml#/paths/sessions-id-route-path' + + '/specs': + $ref: 'shared/specs.yml#/paths/specs' + '/specs/{id}': + $ref: 'shared/specs.yml#/paths/specs-id' + '/specs/{id}/spec': + $ref: 'shared/specs.yml#/paths/specs-id-spec' + + '/summary': + $ref: 'management/summary.yml#/paths/summary' + + '/terminators': + $ref: 'management/terminators.yml#/paths/terminators' + '/terminators/{id}': + $ref: 'management/terminators.yml#/paths/terminators-id' + + '/routers': + $ref: 'management/routers.yml#/paths/routers' + '/transit-routers': + $ref: 'management/routers.yml#/paths/transit-routers' + '/routers/{id}': + $ref: 'management/routers.yml#/paths/routers-id' + '/transit-routers/{id}': + $ref: 'management/routers.yml#/paths/transit-routers-id' + + '/version': + $ref: 'shared/version.yml#/paths/version' + +definitions: + # Polymorphic types are aren't explicitly used anywhere except here. Removal will cause them to be trimmed + + postureCheckFailureMacAddress: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureMacAddress' + + postureCheckFailureDomain: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureDomain' + + postureCheckFailureOperatingSystem: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureOperatingSystem' + + postureCheckFailureProcess: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureProcess' + + postureCheckFailureProcessMulti: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureProcessMulti' + + postureCheckFailureMfa: + $ref: 'management/failed-service-request.yml#/definitions/postureCheckFailureMfa' + + postureCheckOperatingSystemDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckOperatingSystemDetail' + postureCheckOperatingSystemCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckOperatingSystemCreate' + postureCheckOperatingSystemUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckOperatingSystemUpdate' + postureCheckOperatingSystemPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckOperatingSystemPatch' + + postureCheckDomainDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckDomainDetail' + postureCheckDomainCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckDomainCreate' + postureCheckDomainUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckDomainUpdate' + postureCheckDomainPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckDomainPatch' + + postureCheckMacAddressDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMacAddressDetail' + postureCheckMacAddressCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMacAddressCreate' + postureCheckMacAddressUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMacAddressUpdate' + postureCheckMacAddressPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMacAddressPatch' + + postureCheckProcessDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessDetail' + postureCheckProcessCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessCreate' + postureCheckProcessUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessUpdate' + postureCheckProcessPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessPatch' + + postureCheckProcessMultiDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessMultiDetail' + postureCheckProcessMultiCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessMultiCreate' + postureCheckProcessMultiUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessMultiUpdate' + postureCheckProcessMultiPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckProcessMultiPatch' + + postureCheckMfaDetail: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMfaDetail' + postureCheckMfaCreate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMfaCreate' + postureCheckMfaUpdate: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMfaUpdate' + postureCheckMfaPatch: + $ref: 'management/posture-checks.yml#/definitions/postureCheckMfaPatch' \ No newline at end of file diff --git a/specs/source/management/api-sessions.yml b/specs/source/management/api-sessions.yml new file mode 100644 index 000000000..b38c72937 --- /dev/null +++ b/specs/source/management/api-sessions.yml @@ -0,0 +1,66 @@ +--- + +paths: + api-sessions: + get: + summary: List active API sessions + description: | + Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint + requries admin access. + security: + - ztSession: [ ] + tags: + - API Session + operationId: listAPISessions + produces: + - application/json; charset=utf-8 + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listAPISessions' + api-sessions-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single API Session + description: Retrieves a single API Session by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - API Session + operationId: detailAPISessions + responses: + '200': + $ref: '#/responses/detailAPISession' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Deletes an API Sessions + description: Deletes and API sesion by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - API Session + operationId: deleteAPISessions + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '403': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listAPISessions: + description: A list of active API Sessions + schema: + $ref: '../shared/api-sessions.yml#/definitions/listAPISessionsEnvelope' + detailAPISession: + description: Retrieves a singular API Session by id + schema: + $ref: '../shared/api-sessions.yml#/definitions/detailApiSessionEnvelope' diff --git a/specs/source/management/authenticators.yml b/specs/source/management/authenticators.yml new file mode 100644 index 000000000..bd6192f04 --- /dev/null +++ b/specs/source/management/authenticators.yml @@ -0,0 +1,126 @@ +--- + +paths: + authenticators: + get: + summary: List authenticators + description: | + Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated. + This endpoint requries admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: listAuthenticators + + responses: + '200': + $ref: '../shared/authenticators.yml#/responses/listAuthenticators' + post: + summary: Creates an authenticator + description: | + Creates an authenticator for a specific identity. Requires admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: createAuthenticator + parameters: + - name: authenticator + in: body + required: true + description: A Authenticator create object + schema: + $ref: '../shared/authenticators.yml#/definitions/authenticatorCreate' + responses: + '201': + description: The create was successful + schema: + $ref: '../shared/authenticators.yml#/definitions/authenticatorCreate' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + authenticators-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single authenticator + description: Retrieves a single authenticator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: detailAuthenticator + responses: + '200': + $ref: '../shared/authenticators.yml#/responses/detailAuthenticator' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on an authenticator + description: Update all fields on an authenticator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: updateAuthenticator + parameters: + - name: authenticator + in: body + required: true + description: 'An authenticator put object' + schema: + $ref: '../shared/authenticators.yml#/definitions/authenticatorUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on an authenticator + description: Update the supplied fields on an authenticator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: patchAuthenticator + parameters: + - name: authenticator + in: body + required: true + description: An authenticator patch object + schema: + $ref: '../shared/authenticators.yml#/definitions/authenticatorPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an Authenticator + description: | + Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in. + Requires admin access. + security: + - ztSession: [ ] + tags: + - Authenticator + operationId: deleteAuthenticator + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' diff --git a/specs/source/management/cas.yml b/specs/source/management/cas.yml new file mode 100644 index 000000000..22a04deaa --- /dev/null +++ b/specs/source/management/cas.yml @@ -0,0 +1,359 @@ +--- +paths: + cas: + get: + summary: List CAs + description: Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: listCas + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listCas' + post: + summary: Creates a CA + description: Creates a CA in an unverified state. Requires admin access. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: createCa + + parameters: + - name: ca + in: body + required: true + description: A CA to create + schema: + $ref: '#/definitions/caCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + cas-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single CA + description: Retrieves a single CA by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: detailCa + responses: + '200': + $ref: '#/responses/detailCa' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a CA + description: Update all fields on a CA by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: updateCa + parameters: + - name: ca + in: body + required: true + description: A CA update object + schema: + $ref: '#/definitions/caUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a CA + description: Update only the supplied fields on a CA by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: patchCa + parameters: + - name: ca + in: body + required: true + description: A CA patch object + schema: + $ref: '#/definitions/caPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a CA + description: | + 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. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: deleteCa + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + cas-id-jwt: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieve the enrollment JWT for a CA + description: | + For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides + the jwt as a text response. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: getCaJwt + produces: + - 'application/jwt' + 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' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + cas-id-verify: + parameters: + - $ref: '../shared/parameters.yml#/id' + post: + summary: Verify a CA + description: | + 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. + security: + - ztSession: [ ] + tags: + - Certificate Authority + operationId: verifyCa + consumes: + - 'text/plain' + parameters: + - name: certificate + required: true + in: body + description: A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken + schema: + type: string + responses: + 200: + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' +responses: + listCas: + description: A list of Certificate Authorities (CAs) + schema: + $ref: '#/definitions/listCasEnvelope' + detailCa: + description: A singular Certificate Authority (CA) resource + schema: + $ref: '#/definitions/detailCaEnvelope' + +definitions: + listCasEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/caList' + detailCaEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/caDetail' + caList: + description: An array of Certificate Authority (CA) resources + type: array + items: + $ref: '#/definitions/caDetail' + caDetail: + description: A Certificate Authority (CA) resource + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - fingerprint + - certPem + - isVerified + - isAutoCaEnrollmentEnabled + - isOttCaEnrollmentEnabled + - isAuthEnabled + - identityRoles + - identityNameFormat + properties: + name: + type: string + fingerprint: + type: string + certPem: + type: string + isVerified: + type: boolean + example: false + verificationToken: + type: string + format: uuid + isAutoCaEnrollmentEnabled: + type: boolean + example: true + isOttCaEnrollmentEnabled: + type: boolean + example: true + isAuthEnabled: + type: boolean + example: true + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityNameFormat: + type: string + caCreate: + description: A create Certificate Authority (CA) object + type: object + required: + - name + - certPem + - isAutoCaEnrollmentEnabled + - isOttCaEnrollmentEnabled + - isAuthEnabled + - identityRoles + properties: + name: + type: string + example: 'Test 3rd Party External CA' + isAutoCaEnrollmentEnabled: + type: boolean + example: true + isAuthEnabled: + type: boolean + example: true + isOttCaEnrollmentEnabled: + type: boolean + example: true + certPem: + type: string + example: | + -----BEGIN CERTIFICATE----- + MIICUjCCAdmgAwIBAgIJANooo7NB+dZZMAoGCCqGSM49BAMCMF4xCzAJBgNVBAYT + AlVTMQswCQYDVQQIDAJOQzETMBEGA1UECgwKTmV0Rm91bmRyeTEtMCsGA1UEAwwk + TmV0Rm91bmRyeSBaaXRpIEV4dGVybmFsIEFQSSBSb290IENBMB4XDTE4MTExNTEy + NTcwOVoXDTM4MTExMDEyNTcwOVowXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5D + MRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0wKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkg + RXh0ZXJuYWwgQVBJIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARwq61Z + Iaqbaw0PDt3frJZaHjkxfZhwYrykI1GlbRNd/jix03lVG9qvpN5Og9fQfFFcFmD/ + 3vCE9S6O0npm0mADQxcBcxbMRAH5dtBuCuiJW6qAAbPgiM32vqSxBiFt0KejYzBh + MB0GA1UdDgQWBBRx1OVGuc/jdltDc8YBtkw8Tbr4fjAfBgNVHSMEGDAWgBRx1OVG + uc/jdltDc8YBtkw8Tbr4fjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB + hjAKBggqhkjOPQQDAgNnADBkAjBDRxNZUaIVpkQKnAgJukl3ysd3/i7Z6hDyIEms + kllz/+ZvmdBp9iedV5o5BvJUggACMCv+UBFlJH7pmsOCo/F45Kk178YsCC7gaMxE + 1ZG1zveyMvsYsH04C9FndE6w2MLvlA== + -----END CERTIFICATE----- + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityNameFormat: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + caUpdate: + type: object + required: + - name + - isAutoCaEnrollmentEnabled + - isOttCaEnrollmentEnabled + - isAuthEnabled + - identityRoles + properties: + name: + type: string + example: My CA + isAutoCaEnrollmentEnabled: + type: boolean + example: true + isOttCaEnrollmentEnabled: + type: boolean + example: true + isAuthEnabled: + type: boolean + example: true + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityNameFormat: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + caPatch: + type: object + properties: + name: + type: string + example: My CA + isAutoCaEnrollmentEnabled: + type: boolean + example: true + isOttCaEnrollmentEnabled: + type: boolean + example: true + isAuthEnabled: + type: boolean + example: true + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityNameFormat: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/management/config-types.yml b/specs/source/management/config-types.yml new file mode 100644 index 000000000..e2aaa7278 --- /dev/null +++ b/specs/source/management/config-types.yml @@ -0,0 +1,234 @@ +--- +paths: + config-types: + get: + summary: List config-types + description: | + Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: listConfigTypes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listConfigTypes' + post: + summary: Create a config-type. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: createConfigType + parameters: + - name: configType + in: body + required: true + description: A config-type to create + schema: + $ref: '#/definitions/configTypeCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + config-types-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single config-type + description: Retrieves a single config-type by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: detailConfigType + responses: + '200': + $ref: '#/responses/detailConfigType' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a config-type + description: Update all fields on a config-type by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: updateConfigType + parameters: + - name: configType + in: body + required: true + description: A config-type update object + schema: + $ref: '#/definitions/configTypeUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a config-type + description: Update the supplied fields on a config-type. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: patchConfigType + parameters: + - name: configType + in: body + required: true + description: A config-type patch object + schema: + $ref: '#/definitions/configTypePatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a config-type + 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. + security: + - ztSession: [ ] + tags: + - Config + operationId: deleteConfigType + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + config-types-id-configs: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Lists the configs of a specific config-type + description: Lists the configs associated to a config-type. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: listConfigsForConfigType + responses: + '200': + $ref: 'configs.yml#/responses/listConfigs' + +responses: + listConfigTypes: + description: A list of config-types + schema: + $ref: '#/definitions/listConfigTypesEnvelope' + detailConfigType: + description: A singular config-type resource + schema: + $ref: '#/definitions/detailConfigTypeEnvelope' + +definitions: + listConfigTypesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/configTypeList' + detailConfigTypeEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/configTypeDetail' + configTypeList: + description: An array of config-type resources + type: array + items: + $ref: '#/definitions/configTypeDetail' + configTypeDetail: + description: A config-type resource + type: object + allOf: + - $ref: '../shared/base-entity.yml#/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 + configTypeCreate: + type: object + description: A config-type create object + required: + - name + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: ziti-tunneler-server.v1 + schema: + description: A JSON schema to enforce configuration against + type: object + additionalProperties: true + configTypeUpdate: + description: A config-type update object + type: object + required: + - name + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: ziti-tunneler-server.v1 + schema: + description: A JSON schema to enforce configuration against + type: object + additionalProperties: true + configTypePatch: + description: A config-type patch object + type: object + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: ziti-tunneler-server.v1 + schema: + description: A JSON schema to enforce configuration against + type: object + additionalProperties: true diff --git a/specs/source/management/configs.yml b/specs/source/management/configs.yml new file mode 100644 index 000000000..a7b2701e3 --- /dev/null +++ b/specs/source/management/configs.yml @@ -0,0 +1,251 @@ +--- +paths: + configs: + get: + summary: List configs + description: | + Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: listConfigs + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listConfigs' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a config resource + description: Create a config resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: createConfig + parameters: + - name: config + in: body + required: true + description: A config to create + schema: + $ref: '#/definitions/configCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + configs-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single config + description: Retrieves a single config by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: detailConfig + responses: + '200': + $ref: '#/responses/detailConfig' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a config + description: Update all fields on a config by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: updateConfig + parameters: + - name: config + in: body + required: true + description: A config update object + schema: + $ref: '#/definitions/configUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a config + description: Update the supplied fields on a config. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: patchConfig + parameters: + - name: config + in: body + required: true + description: A config patch object + schema: + $ref: '#/definitions/configPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a config + description: Delete a config by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Config + operationId: deleteConfig + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + +responses: + listConfigs: + description: A list of configs + schema: + $ref: '#/definitions/listConfigsEnvelope' + detailConfig: + description: A singular config resource + schema: + $ref: '#/definitions/detailConfigEnvelope' + +definitions: + listConfigsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/configList' + detailConfigEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/configDetail' + configList: + description: An array of config resources + type: array + items: + $ref: '#/definitions/configDetail' + configDetail: + description: A config resource + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - configTypeId + - configType + - data + properties: + name: + type: string + configTypeId: + type: string + configType: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + data: + type: object + description: The data section of a config is based on the schema of its type + configCreate: + type: object + description: A config create object + required: + - name + - configTypeId + - data + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: default.ziti-tunneler-server.v1 + configTypeId: + type: string + description: The id of a config-type that the data section will match + data: + type: object + x-nullable: false + additionalProperties: true + description: Data payload is defined by the schema of the config-type defined in the type parameter + example: + name: test-config + configTypeId: cea49285-6c07-42cf-9f52-09a9b115c783 + data: + hostname: example.com + port: 80 + configUpdate: + type: object + description: A config update object + required: + - name + - data + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: default.ziti-tunneler-server.v1 + data: + type: object + x-nullable: false + additionalProperties: true + description: Data payload is defined by the schema of the config-type defined in the type parameter + example: + name: example-config-name + data: + hostname: example.com + port: 80 + configPatch: + type: object + description: A config patch object + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + example: default.ziti-tunneler-server.v1 + data: + type: object + additionalProperties: true + description: Data payload is defined by the schema of the config-type defined in the type parameter + example: + name: example-config-name + data: + hostname: example.com + port: 80 \ No newline at end of file diff --git a/specs/source/management/database.yml b/specs/source/management/database.yml new file mode 100644 index 000000000..77756088f --- /dev/null +++ b/specs/source/management/database.yml @@ -0,0 +1,123 @@ +--- +paths: + database-snapshot: + post: + summary: Create a new database snapshot + description: Create a new database snapshot. Requires admin access. + security: + - ztSession: [ ] + tags: + - Database + operationId: createDatabaseSnapshot + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '429': + $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + database-check-data-integrity: + post: + summary: Starts a data integrity scan on the datastore + description: Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity. + security: + - ztSession: [ ] + tags: + - Database + operationId: checkDataIntegrity + responses: + '202': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '429': + $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + database-fix-data-integrity: + post: + summary: Runs a data integrity scan on the datastore, attempts to fix any issues it can and returns any found issues + 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. + security: + - ztSession: [ ] + tags: + - Database + operationId: fixDataIntegrity + responses: + '202': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '429': + $ref: '../shared/standard-responses.yml#/responses/rateLimitedResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + database-data-integrity-results: + get: + summary: Returns any results found from in-progress integrity checks + description: Returns any results found from in-progress integrity checks. Requires admin access. + security: + - ztSession: [ ] + tags: + - Database + operationId: dataIntegrityResults + responses: + '200': + $ref: '#/responses/dataIntegrityCheckResult' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + dataIntegrityCheckResult: + description: A list of data integrity issues found + schema: + $ref: '#/definitions/dataIntegrityCheckResultEnvelope' + +definitions: + dataIntegrityCheckResultEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/dataIntegrityCheckDetails' + dataIntegrityCheckDetails: + type: object + required: + - inProgress + - fixingErrors + - tooManyErrors + - startTime + - endTime + - error + - results + properties: + inProgress: + type: boolean + startTime: + type: string + format: date-time + endTime: + type: string + format: date-time + fixingErrors: + type: boolean + error: + type: string + tooManyErrors: + type: boolean + results: + $ref: '#/definitions/dataIntegrityCheckDetailList' + dataIntegrityCheckDetailList: + type: array + items: + $ref: '#/definitions/dataIntegrityCheckDetail' + dataIntegrityCheckDetail: + type: object + required: + - description + - fixed + properties: + description: + type: string + fixed: + type: boolean \ No newline at end of file diff --git a/specs/source/management/edge-router-policies.yml b/specs/source/management/edge-router-policies.yml new file mode 100644 index 000000000..945347549 --- /dev/null +++ b/specs/source/management/edge-router-policies.yml @@ -0,0 +1,268 @@ +--- +paths: + edge-router-policies: + get: + summary: List edge router policies + description: | + Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: listEdgeRouterPolicies + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listEdgeRouterPolicies' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create an edge router policy resource + description: Create an edge router policy resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: createEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: An edge router policy to create + schema: + $ref: '#/definitions/edgeRouterPolicyCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-router-policies-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single edge router policy + description: Retrieves a single edge router policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: detailEdgeRouterPolicy + responses: + '200': + $ref: '#/responses/detailEdgeRouterPolicy' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on an edge router policy + description: Update all fields on an edge router policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: updateEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: An edge router policy update object + schema: + $ref: '#/definitions/edgeRouterPolicyUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on an edge router policy + description: Update the supplied fields on an edge router policy. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: patchEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: An edge router policy patch object + schema: + $ref: '#/definitions/edgeRouterPolicyPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an edge router policy + description: Delete an edge router policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: deleteEdgeRouterPolicy + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + edge-router-policies-id-edge-routers: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List edge routers a policy affects + description: | + Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: listEdgeRouterPolicyEdgeRouters + responses: + '200': + $ref: 'edge-routers.yml#/responses/listEdgeRouters' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-router-policies-id-identities: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List identities an edge router policy affects + description: | + Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router Policy + operationId: listEdgeRouterPolicyIdentities + responses: + '200': + $ref: 'identities.yml#/responses/listIdentities' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listEdgeRouterPolicies: + description: A list of edge router policies + schema: + $ref: '#/definitions/listEdgeRouterPoliciesEnvelope' + detailEdgeRouterPolicy: + description: A single edge router policy + schema: + $ref: '#/definitions/detailEdgeRouterPolicyEnvelope' + +definitions: + listEdgeRouterPoliciesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/edgeRouterPolicyList' + detailEdgeRouterPolicyEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/edgeRouterPolicyDetail' + edgeRouterPolicyCreate: + required: + - name + properties: + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + edgeRouterPolicyUpdate: + required: + - name + properties: + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + edgeRouterPolicyPatch: + properties: + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + edgeRouterPolicyList: + type: array + items: + $ref: '#/definitions/edgeRouterPolicyDetail' + edgeRouterPolicyDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - semantic + - edgeRouterRoles + - edgeRouterRolesDisplay + - identityRoles + - identityRolesDisplay + - isSystem + properties: + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + edgeRouterRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + isSystem: + type: boolean \ No newline at end of file diff --git a/specs/source/management/edge-routers.yml b/specs/source/management/edge-routers.yml new file mode 100644 index 000000000..ac8b224c6 --- /dev/null +++ b/specs/source/management/edge-routers.yml @@ -0,0 +1,369 @@ +--- + +paths: + edge-routers: + get: + summary: List edge routers + description: | + Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: listEdgeRouters + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + - $ref: '../shared/parameters.yml#/roleFilter' + - $ref: '../shared/parameters.yml#/roleSemantic' + responses: + '200': + $ref: '#/responses/listEdgeRouters' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create an edge router + description: Create a edge router resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: createEdgeRouter + parameters: + - name: edgeRouter + in: body + required: true + description: A edge router to create + schema: + $ref: '#/definitions/edgeRouterCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-routers-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single edge router + description: Retrieves a single edge router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: detailEdgeRouter + responses: + '200': + $ref: '#/responses/detailEdgeRouter' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on an edge router + description: Update all fields on an edge router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: updateEdgeRouter + parameters: + - name: edgeRouter + in: body + required: true + description: An edge router update object + schema: + $ref: '#/definitions/edgeRouterUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on an edge router + description: Update the supplied fields on an edge router. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: patchEdgeRouter + parameters: + - name: edgeRouter + in: body + required: true + description: An edge router patch object + schema: + $ref: '#/definitions/edgeRouterPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an edge router + description: Delete an edge router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: deleteEdgeRouter + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + edge-routers-id-edge-router-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the edge router policies that affect an edge router + description: Retrieves a list of edge router policies that apply to the specified edge router. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: listEdgeRouterEdgeRouterPolicies + responses: + '200': + $ref: 'edge-router-policies.yml#/responses/listEdgeRouterPolicies' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-routers-id-identities: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List associated identities + description: | + Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: listEdgeRouterIdentities + responses: + '200': + $ref: 'identities.yml#/responses/listIdentities' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-routers-id-service-edge-router-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the service policies that affect an edge router + description: Retrieves a list of service policies policies that apply to the specified edge router. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: listEdgeRouterServiceEdgeRouterPolicies + responses: + '200': + $ref: 'service-policies.yml#/responses/listServicePolicies' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + edge-routers-id-services: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List associated services + description: | + Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Edge Router + operationId: listEdgeRouterServices + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listEdgeRouters: + description: A list of edge routers + schema: + $ref: '#/definitions/listEdgeRoutersEnvelope' + detailEdgeRouter: + description: A singular edge router resource + schema: + $ref: '#/definitions/detailedEdgeRouterEnvelope' + +definitions: + listEdgeRoutersEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/edgeRouterList' + detailedEdgeRouterEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/edgeRouterDetail' + edgeRouterCreate: + description: An edge router create object + type: object + required: + - name + properties: + name: + type: string + isTunnelerEnabled: + type: boolean + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + + edgeRouterUpdate: + description: An edge router update object + type: object + required: + - name + properties: + name: + type: string + isTunnelerEnabled: + type: boolean + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + + edgeRouterPatch: + description: An edge router patch object + type: object + properties: + name: + type: string + isTunnelerEnabled: + type: boolean + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + edgeRouterList: + description: A list of edge router resources + type: array + items: + $ref: '#/definitions/edgeRouterDetail' + edgeRouterDetail: + description: A detail edge router resource + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - $ref: '../shared/edge-routers.yml#/definitions/commonEdgeRouterProperties' + - type: object + required: + - isVerified + - roleAttributes + - os + - version + - arch + - buildDate + - revision + - isTunnelerEnabled + properties: + isVerified: + type: boolean + enrollmentToken: + type: string + x-nullable: true + enrollmentJwt: + type: string + x-nullable: true + enrollmentCreatedAt: + type: string + format: date-time + x-nullable: true + enrollmentExpiresAt: + type: string + format: date-time + x-nullable: true + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + fingerprint: + type: string + versionInfo: + $ref: '../shared/version.yml#/definitions/versionInfo' + isTunnelerEnabled: + type: boolean + example: + id: b0766b8d-bd1a-4d28-8415-639b29d3c83d + createdAt: '2020-03-16T17:13:31.5807454Z' + updatedAt: '2020-03-16T17:13:31.5807454Z' + _links: + edge-router-policies: + href: "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d/edge-routers" + self: + href: "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d" + tags: { } + name: TestRouter-e33c837f-3222-4b40-bcd6-b3458fd5156e + fingerprint: + roleAttributes: + - eastCoast + - sales + - test + isVerified: false + isOnline: false + isTunnelerEnabled: false + enrollmentToken: 30a1f0ea-d39b-4aae-b852-304cf1c30d1f + enrollmentJwt: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImVyb3R0IiwiZXhwIjoxNTg0Mzc5MTExLCJpc3MiOiJodHRwczovL + 2xvY2FsaG9zdDoxMjgwIiwianRpIjoiMzBhMWYwZWEtZDM5Yi00YWFlLWI4NTItMzA0Y2YxYzMwZDFmIiwic3ViIjoiYjA3NjZiOGQtYmQxYS00ZDI + 4LTg0MTUtNjM5YjI5ZDNjODNkIn0.UsyQhCPORQ5tQnYWY7S88LNvV9iFS5Hy-P4aJaClZzEICobKgnQoyQblJcdMvk3cGKwyFqAnQtt0tDZkb8tHz + Vqyv6bilHcAFuMRrdwXRqdXquabSN5geu2qBUnyzL7Mf2X85if8sbMida6snB4oLZsVRF3CRn4ODBJdeiVJ_Z4rgD-zW2IwtXPApT7ALyiiw2cN4EH + 8pqQ7tpZKqztE0PGEbBQFPGKUFnm7oXyvSUo17EsFJUv5gUlBzfKKGolh5io4ptp22HZrqsqSnqDSOnYEZHonr5Yljuwiktrlh-JKiK6GGns5OAJMP + dO9lgM4yHSpF2ILbqhWMV93Y3zMOg' + enrollmentCreatedAt: '2020-03-16T17:13:31.5777637Z' + enrollmentExpiresAt: '2020-03-16T17:18:31.5777637Z' + hostname: '' + supportedProtocols: { } + routerEntityRef: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/entityRef' + - type: object + required: + - isOnline + properties: + isOnline: + type: boolean \ No newline at end of file diff --git a/specs/source/management/enrollments.yml b/specs/source/management/enrollments.yml new file mode 100644 index 000000000..4523f5ecd --- /dev/null +++ b/specs/source/management/enrollments.yml @@ -0,0 +1,151 @@ +--- +paths: + enrollments: + get: + summary: List outstanding enrollments + description: | + Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Enrollment + operationId: listEnrollments + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listEnrollments' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + enrollments-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves an outstanding enrollment + description: Retrieves a single outstanding enrollment by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Enrollment + operationId: detailEnrollment + responses: + '200': + $ref: '#/responses/detailEnrollment' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an outstanding enrollment + description: Delete an outstanding enrollment by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Enrollment + operationId: deleteEnrollment + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listEnrollments: + description: A list of enrollments + schema: + $ref: '#/definitions/listEnrollmentsEnvelope' + detailEnrollment: + description: A singular enrollment resource + schema: + $ref: '#/definitions/detailEnrollmentEnvelope' + +definitions: + listEnrollmentsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/enrollmentList' + detailEnrollmentEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/enrollmentDetail' + enrollmentList: + description: An array of enrollment resources + type: array + items: + $ref: '#/definitions/enrollmentDetail' + enrollmentDetail: + type: object + description: | + An enrollment object. Enrolments are tied to identities and portentially 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. + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - token + - method + - expiresAt + - details + properties: + token: + type: string + method: + type: string + expiresAt: + type: string + format: date-time + identityId: + type: string + identity: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + edgeRouterId: + type: string + edgeRouter: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + transitRouterId: + type: string + transitRouter: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + username: + type: string + details: + type: object + additionalProperties: + type: string + example: + id: 624fa53f-7629-4a7a-9e38-c1f4ce322c1d + createdAt: '0001-01-01T00:00:00Z' + updatedAt: '0001-01-01T00:00:00Z' + _links: + self: + href: './enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d' + tags: + token: 1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1 + method: updb + expiresAt: '2020-03-11T20:20:24.0055543Z' + identity: + urlName: identities + id: f047ac96-dc3a-408a-a6f2-0ba487c08ef9 + name: updb--0f245140-7f2e-4326-badf-6aba55e52475 + _links: + self: + href: './identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9' + ca: + username: example-username \ No newline at end of file diff --git a/specs/source/management/failed-service-request.yml b/specs/source/management/failed-service-request.yml new file mode 100644 index 000000000..24bf65f7b --- /dev/null +++ b/specs/source/management/failed-service-request.yml @@ -0,0 +1,190 @@ +--- + +definitions: + failedServiceRequestEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/failedServiceRequestList' + failedServiceRequestList: + type: array + items: + $ref: '#/definitions/failedServiceRequest' + failedServiceRequest: + type: object + properties: + apiSessionId: + type: string + when: + type: string + format: date-time + serviceId: + type: string + serviceName: + type: string + sessionType: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + policyFailures: + type: array + items: + $ref: '#/definitions/policyFailure' + policyFailure: + type: object + properties: + policyId: + type: string + policyName: + type: string + checks: + type: array + items: + $ref: '#/definitions/postureCheckFailure' + postureCheckFailure: + type: object + discriminator: postureCheckType + required: + - postureCheckId + - postureCheckName + - postureCheckType + properties: + postureCheckId: + type: string + postureCheckName: + type: string + postureCheckType: + type: string + + postureCheckFailureMacAddress: + x-class: MAC + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + properties: + actualValue: + type: array + items: + type: string + expectedValue: + type: array + items: + type: string + + postureCheckFailureDomain: + x-class: DOMAIN + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + properties: + actualValue: + type: string + expectedValue: + type: array + items: + type: string + postureCheckFailureOperatingSystemActual: + type: object + required: + - type + - version + properties: + type: + type: string + version: + type: string + + postureCheckFailureOperatingSystem: + x-class: OS + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + properties: + actualValue: + $ref: '#/definitions/postureCheckFailureOperatingSystemActual' + expectedValue: + type: array + minItems: 1 + items: + $ref: 'posture-checks.yml#/definitions/operatingSystem' + + postureCheckFailureProcessActual: + type: object + required: + - isRunning + - hash + - signerFingerprints + properties: + path: + type: string + isRunning: + type: boolean + hash: + type: string + signerFingerprints: + type: array + items: + type: string + osType: + $ref: '../shared/posture-checks.yml#/definitions/osType' + + postureCheckFailureProcess: + x-class: PROCESS + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + properties: + actualValue: + $ref: '#/definitions/postureCheckFailureProcessActual' + expectedValue: + $ref: 'posture-checks.yml#/definitions/process' + + postureCheckFailureProcessMulti: + x-class: PROCESS_MULTI + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + - semantic + properties: + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + actualValue: + type: array + items: + $ref: '#/definitions/postureCheckFailureProcessActual' + expectedValue: + type: array + items: + $ref: 'posture-checks.yml#/definitions/processMulti' + + postureCheckFailureMfa: + x-class: MFA + allOf: + - $ref: '#/definitions/postureCheckFailure' + - type: object + required: + - actualValue + - expectedValue + properties: + actualValue: + type: boolean + expectedValue: + type: boolean \ No newline at end of file diff --git a/specs/source/management/identities.yml b/specs/source/management/identities.yml new file mode 100644 index 000000000..607b1d7cf --- /dev/null +++ b/specs/source/management/identities.yml @@ -0,0 +1,525 @@ +--- +paths: + identities: + get: + summary: List identities + description: | + Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentities + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + - $ref: '../shared/parameters.yml#/roleFilter' + - $ref: '../shared/parameters.yml#/roleSemantic' + responses: + '200': + $ref: '#/responses/listIdentities' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create an identity resource + description: Create an identity resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: createIdentity + parameters: + - name: identity + in: body + required: true + description: An identity to create + schema: + $ref: '#/definitions/identityCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single identity + description: Retrieves a single identity by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: detailIdentity + responses: + '200': + $ref: '#/responses/detailIdentity' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on an identity + description: Update all fields on an identity by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: updateIdentity + parameters: + - name: identity + in: body + required: true + description: An identity update object + schema: + $ref: '#/definitions/identityUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on an identity + description: Update the supplied fields on an identity. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: patchIdentity + parameters: + - name: identity + in: body + required: true + description: An identity patch object + schema: + $ref: '#/definitions/identityPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete an identity + description: Delete an identity by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: deleteIdentity + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + identities-id-edge-router-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the edge router policies that affect an identity + description: Retrieves a list of edge router policies that apply to the specified identity. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentitysEdgeRouterPolicies + responses: + '200': + $ref: 'edge-router-policies.yml#/responses/listEdgeRouterPolicies' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id-service-configs: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the service configs associated a specific identity + description: Retrieves a list of service configs associated to a specific identity + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentitysServiceConfigs + responses: + '200': + $ref: '#/responses/listServiceConfigs' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Associate service configs for a specific identity + description: Associate service configs to a specific identity + parameters: + - name: serviceConfigs + in: body + required: true + description: A service config patch object + schema: + $ref: 'service-configs.yml#/definitions/serviceConfigsAssignList' + security: + - ztSession: [ ] + tags: + - Identity + operationId: associateIdentitysServiceConfigs + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Remove associated service configs from a specific identity + description: Remove service configs from a specific identity + parameters: + - name: serviceConfigIdPairs + in: body + required: false + description: An array of service and config id pairs to remove + schema: + $ref: 'service-configs.yml#/definitions/serviceConfigsAssignList' + security: + - ztSession: [ ] + tags: + - Identity + operationId: disassociateIdentitysServiceConfigs + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id-service-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the service policies that affect an identity + description: Retrieves a list of service policies that apply to the specified identity. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentityServicePolicies + responses: + '200': + $ref: 'service-policies.yml#/responses/listServicePolicies' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + identities-id-edge-routers: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List accessible edge-routers + description: | + Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentityEdgeRouters + responses: + '200': + $ref: 'edge-routers.yml#/responses/listEdgeRouters' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + identities-id-services: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List accessible services + description: | + Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentityServices + responses: + '200': + $ref: 'edge-routers.yml#/responses/listEdgeRouters' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + identities-id-policy-advice-service-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + - $ref: '../shared/parameters.yml#/serviceId' + get: + summary: Analyze policies relating the given identity and service + description: | + 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. + security: + - ztSession: [ ] + tags: + - Identity + operationId: getIdentityPolicyAdvice + responses: + '200': + $ref: '#/responses/getIdentityPolicyAdvice' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id-posture-data: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieve the curent posture data for a specific identity. + description: | + Returns a nested map data represeting the posture data of the identity. + This data should be considered volatile. + security: + - ztSession: [ ] + tags: + - Identity + operationId: getIdentityPostureData + responses: + '200': + $ref: '#/responses/getIdentityPostureData' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id-failed-service-requests: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieve a list of the most recent service failure requests due to posture checks + description: | + 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. + security: + - ztSession: [ ] + tags: + - Identity + operationId: getIdentityFailedServiceRequests + responses: + '200': + $ref: '#/responses/getIdentityFailedServiceRequest' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identities-id-mfa: + parameters: + - $ref: '../shared/parameters.yml#/id' + delete: + summary: Remove MFA from an identitity + description: | + Allows an admin to remove MFA enrollment from a specific identity. Requires admin. + security: + - ztSession: [ ] + tags: + - Identity + - MFA + operationId: removeIdentityMfa + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/emptyResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listIdentities: + description: A list of identities + schema: + $ref: '#/definitions/listIdentitiesEnvelope' + detailIdentity: + description: A signle identity + schema: + $ref: '#/definitions/detailIdentityEnvelope' + getIdentityPolicyAdvice: + description: Returns the document that represents the policy advice + schema: + $ref: '#/definitions/getIdentityPolicyAdviceEnvelope' + getIdentityPostureData: + description: Returns the document that represents posture data + schema: + $ref: 'posture-data.yml#/definitions/postureDataEnvelope' + getIdentityFailedServiceRequest: + description: Returns a list of service request failures + schema: + $ref: 'failed-service-request.yml#/definitions/failedServiceRequestEnvelope' + listServiceConfigs: + description: A list of service configs + schema: + $ref: 'service-configs.yml#/definitions/listServiceConfigsEnvelope' + +definitions: + listIdentitiesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '../shared/identities.yml#/definitions/identityList' + detailIdentityEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '../shared/identities.yml#/definitions/identityDetail' + identityCreate: + description: An identity to create + type: object + required: + - name + - type + - isAdmin + properties: + name: + type: string + type: + $ref: 'identity-types.yml#/definitions/identityType' + isAdmin: + type: boolean + enrollment: + type: object + properties: + ott: + type: boolean + updb: + type: string + ottca: + type: string + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + defaultHostingPrecedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + defaultHostingCost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + serviceHostingPrecedences: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedenceMap' + serviceHostingCosts: + $ref: '../shared/terminators.yml#/definitions/terminatorCostMap' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + identityUpdate: + type: object + required: + - type + - name + - isAdmin + properties: + name: + type: string + type: + $ref: 'identity-types.yml#/definitions/identityType' + isAdmin: + type: boolean + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + defaultHostingPrecedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + defaultHostingCost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + serviceHostingPrecedences: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedenceMap' + serviceHostingCosts: + $ref: '../shared/terminators.yml#/definitions/terminatorCostMap' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + identityPatch: + type: object + properties: + name: + type: string + type: + $ref: 'identity-types.yml#/definitions/identityType' + isAdmin: + type: boolean + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + defaultHostingPrecedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + defaultHostingCost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + serviceHostingPrecedences: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedenceMap' + serviceHostingCosts: + $ref: '../shared/terminators.yml#/definitions/terminatorCostMap' + appData: + $ref: '../shared/base-entity.yml#/definitions/tags' + getIdentityPolicyAdviceEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/policyAdvice' + policyAdvice: + type: "object" + properties: + identityId: + type: "string" + identity: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + serviceId: + type: "string" + service: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + isBindAllowed: + type: "boolean" + isDialAllowed: + type: "boolean" + identityRouterCount: + type: "number" + format: int32 + serviceRouterCount: + type: "number" + format: int32 + commonRouters: + type: "array" + items: + $ref: 'edge-routers.yml#/definitions/routerEntityRef' diff --git a/specs/source/management/identity-types.yml b/specs/source/management/identity-types.yml new file mode 100644 index 000000000..047c925e7 --- /dev/null +++ b/specs/source/management/identity-types.yml @@ -0,0 +1,91 @@ +--- + +paths: + identity-types: + get: + summary: List available identity types + description: | + Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: listIdentityTypes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listIdentityTypes' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + identity-types-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a identity type + description: Retrieves a single identity type by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Identity + operationId: detailIdentityType + responses: + '200': + $ref: '#/responses/detailIdentityType' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listIdentityTypes: + description: A list of identity types + schema: + $ref: '#/definitions/listIdentityTypesEnvelope' + detailIdentityType: + description: A single identity type + schema: + $ref: '#/definitions/detailIdentityTypeEnvelope' + +definitions: + identityType: + type: string + enum: + - User + - Device + - Service + - Router + listIdentityTypesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/identityTypeList' + detailIdentityTypeEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/identityTypeDetail' + identityTypeList: + type: array + items: + $ref: '#/definitions/identityTypeDetail' + identityTypeDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + properties: + name: + type: string \ No newline at end of file diff --git a/specs/source/management/posture-check-types.yml b/specs/source/management/posture-check-types.yml new file mode 100644 index 000000000..88544d24a --- /dev/null +++ b/specs/source/management/posture-check-types.yml @@ -0,0 +1,92 @@ +--- +paths: + posture-check-types: + get: + summary: List a subset of posture check types + description: | + Retrieves a list of posture check types + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: listPostureCheckTypes + produces: + - application/json; charset=utf-8 + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listPostureCheckTypes' + posture-check-types-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single posture check type + description: Retrieves a single posture check type by id + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: detailPostureCheckType + responses: + '200': + $ref: '#/responses/detailPostureCheckType' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listPostureCheckTypes: + description: A list of posture check types + schema: + $ref: '#/definitions/listPostureCheckTypesEnvelope' + detailPostureCheckType: + description: Retrieves a singular posture check type by id + schema: + $ref: '#/definitions/detailPostureCheckTypeEnvelope' + +definitions: + listPostureCheckTypesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/postureCheckTypeList' + detailPostureCheckTypeEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/postureCheckTypeDetail' + postureCheckTypeList: + type: array + items: + $ref: '#/definitions/postureCheckTypeDetail' + postureCheckTypeDetail: + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - operatingSystems + - version + properties: + name: + type: string + operatingSystems: + type: array + items: + $ref: 'posture-checks.yml#/definitions/operatingSystem' + version: + type: string \ No newline at end of file diff --git a/specs/source/management/posture-checks.yml b/specs/source/management/posture-checks.yml new file mode 100644 index 000000000..44efaf3d2 --- /dev/null +++ b/specs/source/management/posture-checks.yml @@ -0,0 +1,590 @@ +--- +paths: + posture-checks: + get: + summary: List a subset of posture checks + description: | + Retrieves a list of posture checks + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: listPostureChecks + produces: + - application/json; charset=utf-8 + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + - $ref: '../shared/parameters.yml#/roleFilter' + - $ref: '../shared/parameters.yml#/roleSemantic' + responses: + '200': + $ref: '#/responses/listPostureChecks' + post: + summary: Creates a Posture Checks + description: Creates a Posture Checks + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: createPostureCheck + parameters: + - name: postureCheck + in: body + required: true + description: A Posture Check to create + schema: + $ref: '#/definitions/postureCheckCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + posture-checks-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single Posture Checks + description: Retrieves a single Posture Checks by id + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: detailPostureCheck + responses: + '200': + $ref: '#/responses/detailPostureCheck' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a Posture Checks + description: Update all fields on a Posture Checks by id + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: updatePostureCheck + parameters: + - name: postureCheck + in: body + required: true + description: A Posture Check update object + schema: + $ref: '#/definitions/postureCheckUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a Posture Checks + description: Update only the supplied fields on a Posture Checks by id + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: patchPostureCheck + parameters: + - name: postureCheck + in: body + required: true + description: A Posture Check patch object + schema: + $ref: '#/definitions/postureCheckPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Deletes an Posture Checks + description: Deletes and Posture Checks by id + security: + - ztSession: [ ] + tags: + - Posture Checks + operationId: deletePostureCheck + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '403': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listPostureChecks: + description: A list of posture checks + schema: + $ref: '#/definitions/listPostureCheckEnvelope' + detailPostureCheck: + description: Retrieves a singular posture check by id + schema: + $ref: '#/definitions/detailPostureCheckEnvelope' + +definitions: + listPostureCheckEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + #can't use postureCheckList as it will cause issues w/ the code generation as of 3/2021 + type: array + items: + $ref: '#/definitions/postureCheckDetail' + detailPostureCheckEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/postureCheckDetail' + operatingSystem: + type: object + required: + - type + - versions + properties: + type: + $ref: '../shared/posture-checks.yml#/definitions/osType' + versions: + type: array + items: + type: string + postureCheckDetail: + type: object + discriminator: typeId + # base is duped here due to a bug in go-swagger that will try to embed a struct in an interface + # see https://github.com/go-swagger/go-swagger/issues/2413 + required: + - name + - typeId + - version + - roleAttributes + - id + - createdAt + - updatedAt + - _links + - tags + properties: + name: + type: string + typeId: + type: string + version: + type: integer + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + _links: + $ref: '../shared/base-entity.yml#/definitions/links' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + postureCheckCreate: + type: object + discriminator: typeId + required: + - name + - typeId + properties: + name: + type: string + typeId: + $ref: '../shared/posture-checks.yml#/definitions/postureCheckType' + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + postureCheckUpdate: + type: object + discriminator: typeId + required: + - name + properties: + name: + type: string + typeId: + $ref: '../shared/posture-checks.yml#/definitions/postureCheckType' + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + postureCheckPatch: + type: object + discriminator: typeId + properties: + name: + type: string + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + + + ################################################################### + # Posture Check Operating System + ################################################################### + postureCheckOperatingSystemDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + - type: object + required: + - operatingSystems + properties: + operatingSystems: + type: array + items: + $ref: '#/definitions/operatingSystem' + x-class: "OS" + + postureCheckOperatingSystemCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + - type: object + required: + - operatingSystems + 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" + postureCheckOperatingSystemPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + - type: object + properties: + operatingSystems: + type: array + minItems: 1 + items: + $ref: '#/definitions/operatingSystem' + x-class: "OS" + + ################################################################### + # Posture Check Domain + ################################################################### + postureCheckDomainDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + - type: object + required: + - domains + properties: + domains: + type: array + minItems: 1 + items: + type: string + x-class: "DOMAIN" + + postureCheckDomainCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + - type: object + required: + - domains + 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" + + postureCheckDomainPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + - type: object + properties: + domains: + type: array + minItems: 1 + items: + type: string + x-class: "DOMAIN" + + ################################################################### + # Posture Check MAC Address + ################################################################### + postureCheckMacAddressDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + - type: object + required: + - macAddresses + properties: + macAddresses: + type: array + minItems: 1 + items: + type: string + + x-class: "MAC" + + postureCheckMacAddressCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + - type: object + required: + - macAddresses + 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" + + postureCheckMacAddressPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + - type: object + properties: + macAddresses: + type: array + minItems: 1 + items: + type: string + x-class: "MAC" + + ################################################################### + # Posture Check Process + ################################################################### + process: + type: object + required: + - osType + - path + properties: + osType: + $ref: '../shared/posture-checks.yml#/definitions/osType' + path: + type: string + hashes: + type: array + items: + type: string + signerFingerprint: + type: string + + postureCheckProcessDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + - type: object + required: + - process + properties: + process: + $ref: '#/definitions/process' + x-class: "PROCESS" + + postureCheckProcessCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + - type: object + required: + - process + 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" + + postureCheckProcessPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + - type: object + properties: + process: + $ref: '#/definitions/process' + x-class: "PROCESS" + + ################################################################### + # Posture Check Process Multi + ################################################################### + processMulti: + type: object + required: + - osType + - path + properties: + osType: + $ref: '../shared/posture-checks.yml#/definitions/osType' + path: + type: string + hashes: + type: array + items: + type: string + signerFingerprints: + type: array + items: + type: string + + postureCheckProcessMultiDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + - type: object + required: + - semantic + - processes + properties: + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + processes: + type: array + minItems: 1 + items: + $ref: '#/definitions/processMulti' + x-class: "PROCESS_MULTI" + + postureCheckProcessMultiCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + - type: object + required: + - semantic + - processes + properties: + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + processes: + type: array + minItems: 1 + items: + $ref: '#/definitions/processMulti' + x-class: "PROCESS_MULTI" + + postureCheckProcessMultiUpdate: + allOf: + - $ref: '#/definitions/postureCheckUpdate' + - type: object + required: + - semantic + - processes + properties: + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + processes: + type: array + minItems: 1 + items: + $ref: '#/definitions/processMulti' + x-class: "PROCESS_MULTI" + + postureCheckProcessMultiPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + - type: object + properties: + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + processes: + type: array + minItems: 1 + items: + $ref: '#/definitions/processMulti' + x-class: "PROCESS_MULTI" + + ################################################################### + # Posture Check MFA + ################################################################### + postureCheckMfaDetail: + allOf: + - $ref: '#/definitions/postureCheckDetail' + x-class: "MFA" + + postureCheckMfaCreate: + allOf: + - $ref: '#/definitions/postureCheckCreate' + x-class: "MFA" + + postureCheckMfaUpdate: + allOf: + - $ref: '#/definitions/postureCheckUpdate' + x-class: "MFA" + + postureCheckMfaPatch: + allOf: + - $ref: '#/definitions/postureCheckPatch' + x-class: "MFA" diff --git a/specs/source/management/posture-data.yml b/specs/source/management/posture-data.yml new file mode 100644 index 000000000..5c19556ad --- /dev/null +++ b/specs/source/management/posture-data.yml @@ -0,0 +1,119 @@ +--- + +definitions: + postureDataEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/postureData' + postureData: + type: object + required: + - mac + - domain + - os + - processes + - apiSessionPostureData + properties: + mac: + $ref: '#/definitions/postureDataMac' + domain: + $ref: '#/definitions/postureDataDomain' + os: + $ref: '#/definitions/postureDataOs' + processes: + type: array + items: + $ref: '#/definitions/postureDataProcess' + apiSessionPostureData: + type: object + additionalProperties: + $ref: '#/definitions/apiSessionPostureData' + postureDataBase: + type: object + required: + - postureCheckId + - timedOut + - lastUpdatedAt + properties: + postureCheckId: + type: string + timedOut: + type: boolean + lastUpdatedAt: + type: string + format: date-time + postureDataMac: + type: object + allOf: + - $ref: '#/definitions/postureDataBase' + - type: object + required: + - addresses + properties: + addresses: + type: array + items: + type: string + postureDataDomain: + type: object + allOf: + - $ref: '#/definitions/postureDataBase' + - type: object + required: + - domain + properties: + domain: + type: string + postureDataOs: + type: object + allOf: + - $ref: '#/definitions/postureDataBase' + - type: object + required: + - type + - version + - build + properties: + type: + type: string + version: + type: string + build: + type: string + postureDataProcess: + type: object + allOf: + - $ref: '#/definitions/postureDataBase' + - type: object + properties: + isRunning: + type: boolean + binaryHash: + type: string + signerFingerprints: + type: array + items: + type: string + postureDataMfa: + type: object + required: + - apiSessionId + - passedMfa + properties: + apiSessionId: + type: string + passedMfa: + type: boolean + apiSessionPostureData: + type: object + required: + - mfa + properties: + mfa: + $ref: '#/definitions/postureDataMfa' \ No newline at end of file diff --git a/specs/source/management/role-attributes.yml b/specs/source/management/role-attributes.yml new file mode 100644 index 000000000..f1daca029 --- /dev/null +++ b/specs/source/management/role-attributes.yml @@ -0,0 +1,84 @@ +--- +paths: + edge-router-role-attributes: + get: + summary: List role attributes in use by edge routers + description: | + Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Role Attributes + operationId: listEdgeRouterRoleAttributes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRoleAttributes' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + identity-role-attributes: + get: + summary: List role attributes in use by identities + description: | + Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Role Attributes + operationId: listIdentityRoleAttributes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRoleAttributes' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + service-role-attributes: + get: + summary: List role attributes in use by services + description: | + Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Role Attributes + operationId: listServiceRoleAttributes + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRoleAttributes' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listRoleAttributes: + description: A list of role attributes + schema: + $ref: '#/definitions/listRoleAttributesEnvelope' + +definitions: + listRoleAttributesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/roleAttributesList' + roleAttributesList: + description: An array of role attributes + type: array + items: + type: string \ No newline at end of file diff --git a/specs/source/management/routers.yml b/specs/source/management/routers.yml new file mode 100644 index 000000000..a81221653 --- /dev/null +++ b/specs/source/management/routers.yml @@ -0,0 +1,345 @@ +--- +paths: + # 'transit-routers' is deprecated, remove after 19.x, use 'routers' instead + transit-routers: + get: + summary: List routers + description: | + Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: listTransitRouters + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRouters' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a router resource + description: Create a router resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: createTransitRouter + parameters: + - name: router + in: body + required: true + description: A router to create + schema: + $ref: '#/definitions/routerCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + transit-routers-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single router + description: Retrieves a single router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: detailTransitRouter + responses: + '200': + $ref: '#/responses/detailRouter' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a router + description: Update all fields on a router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: updateTransitRouter + parameters: + - name: router + in: body + required: true + description: A router update object + schema: + $ref: '#/definitions/routerUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a router + description: Update the supplied fields on a router. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: patchTransitRouter + parameters: + - name: router + in: body + required: true + description: A router patch object + schema: + $ref: '#/definitions/routerPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a router + description: Delete a router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: deleteTransitRouter + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + routers: + get: + summary: List routers + description: | + Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: listRouters + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listRouters' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a router resource + description: Create a router resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: createRouter + parameters: + - name: router + in: body + required: true + description: A router to create + schema: + $ref: '#/definitions/routerCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + routers-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single router + description: Retrieves a single router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: detailRouter + responses: + '200': + $ref: '#/responses/detailRouter' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a router + description: Update all fields on a router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: updateRouter + parameters: + - name: router + in: body + required: true + description: A router update object + schema: + $ref: '#/definitions/routerUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a router + description: Update the supplied fields on a router. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: patchRouter + parameters: + - name: router + in: body + required: true + description: A router patch object + schema: + $ref: '#/definitions/routerPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a router + description: Delete a router by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Router + operationId: deleteRouter + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + +responses: + listRouters: + description: A list of specifications + schema: + $ref: '#/definitions/listRoutersEnvelope' + detailRouter: + description: A single router + schema: + $ref: '#/definitions/detailRouterEnvelope' + +definitions: + listRoutersEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/routerList' + detailRouterEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/routerDetail' + routerList: + type: array + items: + $ref: '#/definitions/routerDetail' + routerDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - isVerified + - isOnline + - fingerprint + properties: + name: + type: string + fingerprint: + type: string + isVerified: + type: boolean + isOnline: + type: boolean + enrollmentToken: + type: string + x-nullable: true + enrollmentJwt: + type: string + x-nullable: true + enrollmentCreatedAt: + type: string + format: date-time + x-nullable: true + enrollmentExpiresAt: + type: string + format: date-time + x-nullable: true + routerCreate: + type: object + required: + - name + properties: + name: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + routerUpdate: + type: object + required: + - name + properties: + name: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + routerPatch: + type: object + properties: + name: + type: string + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/management/service-configs.yml b/specs/source/management/service-configs.yml new file mode 100644 index 000000000..93c78f7d1 --- /dev/null +++ b/specs/source/management/service-configs.yml @@ -0,0 +1,61 @@ +--- +definitions: + listServiceConfigsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/serviceConfigList' + serviceConfigList: + type: array + items: + $ref: '#/definitions/serviceConfigDetail' + serviceConfigDetail: + type: object + required: + - serviceId + - service + - configId + - config + properties: + serviceId: + type: string + service: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + configId: + type: string + config: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + example: + service: + urlName: services + id: 913a8c63-17a6-44d7-82b3-9f6eb997cf8e + name: netcat4545-egress-r2 + _links: + self: + href: "./services/913a8c63-17a6-44d7-82b3-9f6eb997cf8e" + config: + urlName: configs + id: 13347602-ba34-4ff7-8082-e533ba945744 + name: test-config-02fade09-fcc3-426c-854e-18539726bdc6 + _links: + self: + href: "./identities/13347602-ba34-4ff7-8082-e533ba945744" + serviceConfigAssign: + type: object + required: + - serviceId + - configId + properties: + serviceId: + type: string + configId: + type: string + serviceConfigsAssignList: + type: array + items: + $ref: '#/definitions/serviceConfigAssign' \ No newline at end of file diff --git a/specs/source/management/service-edge-router-policies.yml b/specs/source/management/service-edge-router-policies.yml new file mode 100644 index 000000000..d5584e22a --- /dev/null +++ b/specs/source/management/service-edge-router-policies.yml @@ -0,0 +1,266 @@ +--- +paths: + service-edge-router-policies: + get: + summary: List service edge router policies + description: | + Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: listServiceEdgeRouterPolicies + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listServiceEdgeRouterPolicies' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a service edge router policy resource + description: Create a service edge router policy resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: createServiceEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: A service edge router policy to create + schema: + $ref: '#/definitions/serviceEdgeRouterPolicyCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + service-edge-router-policies-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single service edge policy + description: Retrieves a single service edge policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: detailServiceEdgeRouterPolicy + responses: + '200': + $ref: '#/responses/detailServiceEdgePolicy' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a service edge policy + description: Update all fields on a service edge policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: updateServiceEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: A service edge router policy update object + schema: + $ref: '#/definitions/serviceEdgeRouterPolicyUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a service edge policy + description: Update the supplied fields on a service edge policy. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: patchServiceEdgeRouterPolicy + parameters: + - name: policy + in: body + required: true + description: A service edge router policy patch object + schema: + $ref: '#/definitions/serviceEdgeRouterPolicyPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a service edge policy + description: Delete a service edge policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: deleteServiceEdgeRouterPolicy + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + service-edge-router-policies-id-edge-routers: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the edge routers that a service edge router policy applies to + description: List the edge routers that a service edge router policy applies to + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: listServiceEdgeRouterPolicyEdgeRouters + responses: + '200': + $ref: 'edge-routers.yml#/responses/listEdgeRouters' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + service-edge-router-policies-id-services: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List the services that a service edge router policy applies to + description: List the services that a service edge router policy applies to + security: + - ztSession: [ ] + tags: + - Service Edge Router Policy + operationId: listServiceEdgeRouterPolicyServices + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listServiceEdgeRouterPolicies: + description: A list of service edge router policies + schema: + $ref: '#/definitions/listServiceEdgeRouterPoliciesEnvelope' + detailServiceEdgePolicy: + description: A single service edge router policy + schema: + $ref: '#/definitions/detailServiceEdgePolicyEnvelope' + +definitions: + listServiceEdgeRouterPoliciesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/serviceEdgeRouterPolicyList' + detailServiceEdgePolicyEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/serviceEdgeRouterPolicyDetail' + serviceEdgeRouterPolicyList: + type: array + items: + $ref: '#/definitions/serviceEdgeRouterPolicyDetail' + serviceEdgeRouterPolicyDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - semantic + - edgeRouterRoles + - edgeRouterRolesDisplay + - serviceRoles + - serviceRolesDisplay + properties: + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + edgeRouterRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + serviceEdgeRouterPolicyCreate: + type: object + required: + - name + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceEdgeRouterPolicyUpdate: + type: object + required: + - name + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceEdgeRouterPolicyPatch: + type: object + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + edgeRouterRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' \ No newline at end of file diff --git a/specs/source/management/service-policies.yml b/specs/source/management/service-policies.yml new file mode 100644 index 000000000..5057bb88b --- /dev/null +++ b/specs/source/management/service-policies.yml @@ -0,0 +1,322 @@ +--- +paths: + service-policies: + get: + summary: List service policies + description: | + Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: listServicePolicies + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listServicePolicies' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a service policy resource + description: Create a service policy resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: createServicePolicy + parameters: + - name: policy + in: body + required: true + description: A service policy to create + schema: + $ref: '#/definitions/servicePolicyCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + service-policies-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single service policy + description: Retrieves a single service policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: detailServicePolicy + responses: + '200': + $ref: '#/responses/detailServicePolicy' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a service policy + description: Update all fields on a service policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: updateServicePolicy + parameters: + - name: policy + in: body + required: true + description: A service policy update object + schema: + $ref: '#/definitions/servicePolicyUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a service policy + description: Update the supplied fields on a service policy. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: patchServicePolicy + parameters: + - name: policy + in: body + required: true + description: A service policy patch object + schema: + $ref: '#/definitions/servicePolicyPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a service policy + description: Delete a service policy by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: deleteServicePolicy + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + service-policies-id-identities: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List identities a service policy affects + description: | + Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: listServicePolicyIdentities + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'identities.yml#/responses/listIdentities' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + service-policies-id-services: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List services a service policy affects + description: | + Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: listServicePolicyServices + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + service-policies-id-posture-checks: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List posture check a service policy includes + description: | + Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service Policy + operationId: listServicePolicyPostureChecks + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'posture-checks.yml#/responses/listPostureChecks' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + +responses: + listServicePolicies: + description: A list of service policies + schema: + $ref: '#/definitions/listServicePoliciesEnvelope' + detailServicePolicy: + description: A single service policy + schema: + $ref: '#/definitions/detailServicePolicyEnvelop' + +definitions: + listServicePoliciesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/servicePolicyList' + detailServicePolicyEnvelop: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/servicePolicyDetail' + servicePolicyList: + type: array + items: + $ref: '#/definitions/servicePolicyDetail' + servicePolicyDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - type + - semantic + - serviceRoles + - serviceRolesDisplay + - identityRoles + - identityRolesDisplay + - postureCheckRoles + - postureCheckRolesDisplay + properties: + name: + type: string + type: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + serviceRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + postureCheckRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + postureCheckRolesDisplay: + $ref: '../shared/base-entity.yml#/definitions/namedRoles' + servicePolicyCreate: + type: object + required: + - name + - type + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + type: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + postureCheckRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + servicePolicyUpdate: + type: object + required: + - name + - type + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + type: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + postureCheckRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + servicePolicyPatch: + type: object + properties: + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + name: + type: string + type: + $ref: '../shared/base-entity.yml#/definitions/dialBind' + semantic: + $ref: '../shared/base-entity.yml#/definitions/semantic' + serviceRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + identityRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' + postureCheckRoles: + $ref: '../shared/base-entity.yml#/definitions/roles' \ No newline at end of file diff --git a/specs/source/management/services.yml b/specs/source/management/services.yml new file mode 100644 index 000000000..e7035bc38 --- /dev/null +++ b/specs/source/management/services.yml @@ -0,0 +1,321 @@ +--- +paths: + services: + get: + summary: List services + description: | + Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServices + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + - $ref: '../shared/parameters.yml#/roleFilter' + - $ref: '../shared/parameters.yml#/roleSemantic' + responses: + '200': + $ref: '../shared/services.yml#/responses/listServices' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a services resource + description: Create a services resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: createService + parameters: + - name: service + in: body + required: true + description: A service to create + schema: + $ref: '#/definitions/serviceCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + services-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single service + description: Retrieves a single service by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: detailService + responses: + '200': + $ref: '../shared/services.yml#/responses/detailService' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a service + description: Update all fields on a service by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: updateService + parameters: + - name: service + in: body + required: true + description: A service update object + schema: + $ref: '#/definitions/serviceUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a service + description: Update the supplied fields on a service. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: patchService + parameters: + - name: service + in: body + required: true + description: A service patch object + schema: + $ref: '#/definitions/servicePatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a service + description: Delete a service by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: deleteService + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + services-id-configs: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List configs associated to a specific service + description: | + Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceConfig + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'configs.yml#/responses/listConfigs' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + services-id-service-edge-router-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List service edge router policies that affect a specific service + description: | + Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceServiceEdgeRouterPolicies + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'service-edge-router-policies.yml#/responses/listServiceEdgeRouterPolicies' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + services-id-service-policies: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List service policies that affect a specific service + description: | + Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceServicePolicies + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'service-policies.yml#/responses/listServicePolicies' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + services-id-identities: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List identities with access + description: | + Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceIdentities + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'identities.yml#/responses/listIdentities' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + services-id-edge-routers: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List accessible edge-routers + description: | + Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceEdgeRouters + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'edge-routers.yml#/responses/listEdgeRouters' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + + services-id-terminators: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: List of terminators assigned to a service + description: | + Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. + security: + - ztSession: [ ] + tags: + - Service + operationId: listServiceTerminators + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: 'terminators.yml#/responses/listTerminators' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +definitions: + serviceCreate: + type: object + required: + - name + - encryptionRequired + properties: + name: + type: string + terminatorStrategy: + type: string + roleAttributes: + type: array + items: + type: string + configs: + type: array + items: + type: string + encryptionRequired: + type: boolean + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + serviceUpdate: + type: object + required: + - name + properties: + name: + type: string + terminatorStrategy: + type: string + roleAttributes: + type: array + items: + type: string + configs: + type: array + items: + type: string + encryptionRequired: + type: boolean + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + servicePatch: + type: object + properties: + name: + type: string + terminatorStrategy: + type: string + roleAttributes: + type: array + items: + type: string + configs: + type: array + items: + type: string + encryptionRequired: + type: boolean + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/management/sessions.yml b/specs/source/management/sessions.yml new file mode 100644 index 000000000..ce4c38de0 --- /dev/null +++ b/specs/source/management/sessions.yml @@ -0,0 +1,102 @@ +--- +paths: + sessions: + get: + summary: List sessions + description: | + 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. + security: + - ztSession: [ ] + tags: + - Session + operationId: listSessions + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '../shared/sessions.yml#/responses/listSessions' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + sessions-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single session + description: Retrieves a single session by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Session + operationId: detailSession + responses: + '200': + $ref: '../shared/sessions.yml#/responses/detailSession' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a session + description: Delete a session by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Session + operationId: deleteSession + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + sessions-id-route-path: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single session's router path + description: Retrieves a single session's route path by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Session + operationId: detailSessionRoutePath + responses: + '200': + $ref: '#/responses/detailSessionRoutePath' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + detailSessionRoutePath: + description: A single session's route path + schema: + $ref: '#/definitions/detailSessionRoutePathEnvelope' + +definitions: + detailSessionRoutePathEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/sessionRoutePathDetail' + sessionRoutePathDetail: + type: object + properties: + routePath: + type: array + items: + type: string \ No newline at end of file diff --git a/specs/source/management/summary.yml b/specs/source/management/summary.yml new file mode 100644 index 000000000..0eba56a64 --- /dev/null +++ b/specs/source/management/summary.yml @@ -0,0 +1,38 @@ +--- +paths: + summary: + get: + summary: Returns a list of accessible resource counts + description: This endpoint is usefull for UIs that wish to display UI elements with counts. + security: + - ztSession: [ ] + tags: + - Informational + operationId: listSummary + responses: + '200': + $ref: '#/responses/listSummaryCounts' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + +responses: + listSummaryCounts: + description: Entity counts scopped to the current identitie's access + schema: + $ref: '#/definitions/listSummaryCountsEnvelope' + +definitions: + listSummaryCountsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/listSummaryCounts' + listSummaryCounts: + type: object + additionalProperties: + type: integer \ No newline at end of file diff --git a/specs/source/management/terminators.yml b/specs/source/management/terminators.yml new file mode 100644 index 000000000..0cf86f3bf --- /dev/null +++ b/specs/source/management/terminators.yml @@ -0,0 +1,265 @@ +--- +paths: + terminators: + get: + summary: List terminators + description: | + Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: listTerminators + parameters: + - $ref: '../shared/parameters.yml#/limit' + - $ref: '../shared/parameters.yml#/offset' + - $ref: '../shared/parameters.yml#/filter' + responses: + '200': + $ref: '#/responses/listTerminators' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + post: + summary: Create a terminator resource + description: Create a terminator resource. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: createTerminator + parameters: + - name: terminator + in: body + required: true + description: A terminator to create + schema: + $ref: '#/definitions/terminatorCreate' + responses: + '201': + $ref: '../shared/standard-responses.yml#/responses/createResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + terminators-id: + parameters: + - $ref: '../shared/parameters.yml#/id' + get: + summary: Retrieves a single terminator + description: Retrieves a single terminator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: detailTerminator + responses: + '200': + $ref: '#/responses/detailTerminator' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on a terminator + description: Update all fields on a terminator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: updateTerminator + parameters: + - name: terminator + in: body + required: true + description: A terminator update object + schema: + $ref: '#/definitions/terminatorUpdate' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/updateResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on a terminator + description: Update the supplied fields on a terminator. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: patchTerminator + parameters: + - name: terminator + in: body + required: true + description: A terminator patch object + schema: + $ref: '#/definitions/terminatorPatch' + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/patchResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: '../shared/standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Delete a terminator + description: Delete a terminator by id. Requires admin access. + security: + - ztSession: [ ] + tags: + - Terminator + operationId: deleteTerminator + responses: + '200': + $ref: '../shared/standard-responses.yml#/responses/deleteResponse' + '400': + $ref: '../shared/standard-responses.yml#/responses/badRequestResponse' + '401': + $ref: '../shared/standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '../shared/standard-responses.yml#/responses/cannotDeleteReferencedResourceResponse' + +responses: + listTerminators: + description: A list of terminators + schema: + $ref: '#/definitions/listTerminatorsEnvelope' + detailTerminator: + description: A single terminator + schema: + $ref: '#/definitions/detailTerminatorEnvelope' + +definitions: + listTerminatorsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/terminatorList' + detailTerminatorEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/terminatorDetail' + terminatorList: + type: array + items: + $ref: '#/definitions/terminatorDetail' + terminatorDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - serviceId + - service + - routerId + - router + - binding + - address + - identity + - cost + - precedence + - dynamicCost + properties: + serviceId: + type: string + service: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + routerId: + type: string + router: + $ref: '../shared/base-entity.yml#/definitions/entityRef' + binding: + type: string + address: + type: string + identity: + type: string + cost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + precedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + dynamicCost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + terminatorCreate: + type: object + required: + - service + - router + - address + - binding + properties: + service: + type: string + router: + type: string + binding: + type: string + address: + type: string + identity: + type: string + identitySecret: + type: string + format: byte + cost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + precedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + terminatorUpdate: + type: object + required: + - service + - router + - address + - binding + properties: + service: + type: string + router: + type: string + binding: + type: string + address: + type: string + cost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + precedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' + terminatorPatch: + type: object + properties: + service: + type: string + router: + type: string + binding: + type: string + address: + type: string + cost: + $ref: '../shared/terminators.yml#/definitions/terminatorCost' + precedence: + $ref: '../shared/terminators.yml#/definitions/terminatorPrecedence' + tags: + $ref: '../shared/base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/shared/api-sessions.yml b/specs/source/shared/api-sessions.yml new file mode 100644 index 000000000..8210e8d4f --- /dev/null +++ b/specs/source/shared/api-sessions.yml @@ -0,0 +1,67 @@ +--- + +definitions: + listAPISessionsEnvelope: + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/apiSessionList' + detailApiSessionEnvelope: + required: + - meta + - data + type: object + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/apiSessionDetail' + apiSessionList: + type: array + items: + $ref: '#/definitions/apiSessionDetail' + apiSessionDetail: + description: An API Session object + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - token + - identity + - identityId + - configTypes + - ipAddress + - authQueries + - cachedUpdatedAt + - isMfaRequired + - isMfaComplete + properties: + token: + type: string + identity: + $ref: 'base-entity.yml#/definitions/entityRef' + identityId: + type: string + ipAddress: + type: string + configTypes: + type: array + items: + type: string + authQueries: + $ref: 'auth-query.yml#/definitions/authQueryList' + isMfaRequired: + type: boolean + isMfaComplete: + type: boolean + lastActivityAt: + type: string + format: date-time + cachedLastActivityAt: + type: string + format: date-time \ No newline at end of file diff --git a/specs/source/shared/auth-query.yml b/specs/source/shared/auth-query.yml new file mode 100644 index 000000000..2ea422955 --- /dev/null +++ b/specs/source/shared/auth-query.yml @@ -0,0 +1,25 @@ +--- +definitions: + authQueryList: + type: array + items: + $ref: '#/definitions/authQueryDetail' + authQueryDetail: + type: object + required: + - provider + properties: + typeId: + type: string + provider: + $ref: 'current-identity-mfa.yml#/definitions/mfaProviders' + httpMethod: + type: string + httpUrl: + type: string + minLength: + type: integer + maxLength: + type: integer + format: + $ref: 'current-identity-mfa.yml#/definitions/mfaFormats' \ No newline at end of file diff --git a/specs/source/shared/authenticate.yml b/specs/source/shared/authenticate.yml new file mode 100644 index 000000000..2990bb41d --- /dev/null +++ b/specs/source/shared/authenticate.yml @@ -0,0 +1,130 @@ +--- + +parameters: + authMethod: + name: method + in: query + required: true + type: string + enum: + - password + - cert +paths: + authenticate: + parameters: + - $ref: '#/parameters/authMethod' + post: + summary: Authenticate via a method supplied via a query string parameter + description: | + Allows authentication Methods include "password" and "cert" + security: [ ] + tags: + - Authentication + operationId: authenticate + parameters: + - name: auth + in: body + required: false + schema: + $ref: '#/definitions/authenticate' + responses: + '200': + $ref: './current-api-session.yml/#/responses/detailCurrentAPISession' + '400': + $ref: './standard-responses.yml#/responses/badRequestResponse' + '403': + $ref: './standard-responses.yml#/responses/invalidAuthResponse' + + authenticate-mfa: + post: + summary: Complete MFA authentication + description: Completes MFA authentication by submitting a MFA time based one time token or backup code. + security: + - ztSession: [ ] + tags: + - Authentication + - MFA + operationId: authenticateMfa + parameters: + - name: mfaAuth + in: body + required: true + description: 'An MFA validation request' + schema: + $ref: '#/definitions/mfaCode' + responses: + '200': + $ref: './standard-responses.yml#/responses/emptyResponse' + '401': + $ref: './standard-responses.yml#/responses/emptyResponse' +responses: + $ref: 'standard-responses.yml#/responses' + +definitions: + mfaCode: + type: object + required: + - code + properties: + code: + type: string + password: + type: string + minLength: 5 + maxLength: 100 + password-nullable: + type: string + minLength: 5 + maxLength: 100 + x-nullable: true + username: + type: string + minLength: 4 + maxLength: 100 + username-nullable: + type: string + minLength: 4 + maxLength: 100 + x-nullable: true + envInfo: + description: Environment information an authenticating client may provide + properties: + os: + type: string + arch: + type: string + osRelease: + type: string + osVersion: + type: string + type: object + sdkInfo: + description: SDK information an authenticating client may provide + properties: + type: + type: string + branch: + type: string + version: + type: string + revision: + type: string + appId: + type: string + appVersion: + type: string + type: object + authenticate: + type: object + description: A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method. + properties: + username: + $ref: '#/definitions/username' + password: + $ref: '#/definitions/password' + envInfo: + $ref: '#/definitions/envInfo' + sdkInfo: + $ref: '#/definitions/sdkInfo' + configTypes: + $ref: 'config-types.yml#/definitions/configTypes' \ No newline at end of file diff --git a/specs/source/shared/authenticators.yml b/specs/source/shared/authenticators.yml new file mode 100644 index 000000000..2e491c352 --- /dev/null +++ b/specs/source/shared/authenticators.yml @@ -0,0 +1,128 @@ +--- + +paths: + +responses: + listAuthenticators: + description: A list of authenticators + schema: + $ref: '#/definitions/listAuthenticatorsEnvelope' + detailAuthenticator: + description: A singular authenticator resource + schema: + $ref: '#/definitions/detailAuthenticatorEnvelope' + +definitions: + listAuthenticatorsEnvelope: + type: object + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/authenticatorList' + detailAuthenticatorEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/authenticatorDetail' + authenticatorCreate: + description: Creates an authenticator for a specific identity which can be used for API authentication + type: object + required: + - username + - password + - method + - identityId + properties: + username: + type: string + description: The username that the identity will login with. Used only for method='updb' + password: + type: string + description: The password the identity will login with, Used only for method='updb' + method: + type: string + description: The type of authenticator to create; which will dictate which properties on this object are required. + identityId: + type: string + description: The id of an existing identity that will be assigned this authenticator + tags: + $ref: 'base-entity.yml#/definitions/tags' + authenticatorList: + description: An array of authenticator resources + type: array + items: + $ref: '#/definitions/authenticatorDetail' + authenticatorDetail: + description: A singular authenticator resource + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - method + - identityId + - identity + properties: + method: + type: string + identityId: + type: string + identity: + $ref: 'base-entity.yml#/definitions/entityRef' + certPem: + type: string + fingerprint: + type: string + username: + type: string + authenticatorUpdate: + description: All of the fields on an authenticator that will be updated + type: object + required: + - username + - password + properties: + username: + $ref: 'authenticate.yml#/definitions/username' + password: + $ref: 'authenticate.yml#/definitions/password' + tags: + $ref: 'base-entity.yml#/definitions/tags' + authenticatorPatch: + description: All of the fields on an authenticator that may be updated + type: object + properties: + username: + $ref: 'authenticate.yml#/definitions/username-nullable' + password: + $ref: 'authenticate.yml#/definitions/password-nullable' + tags: + $ref: 'base-entity.yml#/definitions/tags' + 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: 'authenticate.yml#/definitions/password' + 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: 'authenticate.yml#/definitions/password' \ No newline at end of file diff --git a/specs/source/shared/base-entity.yml b/specs/source/shared/base-entity.yml new file mode 100644 index 000000000..25efed494 --- /dev/null +++ b/specs/source/shared/base-entity.yml @@ -0,0 +1,99 @@ +--- +definitions: + baseEntity: + description: Fields shared by all Edge API entities + type: object + required: + - id + - createdAt + - updatedAt + - _links + - tags + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + _links: + $ref: '#/definitions/links' + tags: + $ref: '#/definitions/tags' + link: + description: A link to another resource + type: object + required: + - href + properties: + href: + type: string + format: uri + method: + type: string + comment: + type: string + links: + description: A map of named links + type: object + x-omitempty: false + additionalProperties: + $ref: '#/definitions/link' + entityRef: + description: A reference to another resource and links to interact with it + type: object + properties: + entity: + type: string + id: + type: string + name: + type: string + _links: + $ref: '#/definitions/links' + tags: + description: 'A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean' + type: object + x-omitempty: false + additionalProperties: { + type: object + } + attributes: + description: A set of strings used to loosly couple this resource to policies + type: array + x-omitempty: false + items: + type: string + roles: + type: array + x-omitempty: false + items: + type: string + namedRole: + type: object + properties: + role: + type: string + name: + type: string + namedRoles: + type: array + x-omitempty: false + items: + $ref: '#/definitions/namedRole' + semantic: + type: string + enum: + - AllOf + - AnyOf + dialBind: + type: string + enum: + - Dial + - Bind + dialBindArray: + type: array + items: + $ref: '#/definitions/dialBind' \ No newline at end of file diff --git a/specs/source/shared/config-types.yml b/specs/source/shared/config-types.yml new file mode 100644 index 000000000..7c2ff5f7c --- /dev/null +++ b/specs/source/shared/config-types.yml @@ -0,0 +1,7 @@ +--- +definitions: + configTypes: + description: Specific configuration types that should be returned + type: array + items: + type: string \ No newline at end of file diff --git a/specs/source/shared/current-api-session.yml b/specs/source/shared/current-api-session.yml new file mode 100644 index 000000000..9d4ceb5b7 --- /dev/null +++ b/specs/source/shared/current-api-session.yml @@ -0,0 +1,94 @@ +--- +paths: + current-api-session: + get: + summary: Return the current API session + description: Retrieves the API session that was used to issue the current request + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: getCurrentAPISession + responses: + 200: + $ref: '#/responses/detailCurrentAPISession' + 401: + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + delete: + summary: Logout + description: Terminates the current API session + security: + - ztSession: [ ] + tags: + - Current API Session + responses: + 200: + $ref: 'standard-responses.yml#/responses/emptyResponse' + 401: + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + +responses: + detailCurrentAPISession: + description: The API session associated with the session used to issue the request + schema: + $ref: '#/definitions/currentApiSessionDetailEnvelope' + examples: + default: + meta: { } + data: + id: 27343114-b44f-406e-9981-f3c4f2f28d54 + createdAt: '2020-03-09T19:03:49.1883693Z' + updatedAt: '2020-03-09T19:04:21.5600897Z' + _links: + self: + href: './current-api-session' + tags: + - userField1: 123 + - userField2: asdf + token: 28bb0ed2-0577-4632-ae70-d17106b92871 + identity: + urlName: identities + id: 66352d7b-a6b2-4ce9-85bb-9f18e318704d + name: Default Admin + _links: + self: + href: './identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d' + expiresAt: '2020-03-09T19:34:21.5600897Z' + configTypes: [ ] + +definitions: + detailApiSessionEnvelope: + required: + - meta + - data + type: object + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: 'api-sessions.yml#/definitions/apiSessionDetail' + currentApiSessionDetailEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/currentApiSessionDetail' + currentApiSessionDetail: + description: An API Session object for the current API session + type: object + allOf: + - $ref: 'api-sessions.yml#/definitions/apiSessionDetail' + - type: object + required: + - expiresAt + - expirationSeconds + properties: + expiresAt: + type: string + format: date-time + expirationSeconds: + type: integer diff --git a/specs/source/shared/current-identity-authenticators.yml b/specs/source/shared/current-identity-authenticators.yml new file mode 100644 index 000000000..b70f58968 --- /dev/null +++ b/specs/source/shared/current-identity-authenticators.yml @@ -0,0 +1,91 @@ +--- + +paths: + current-identity-authenticators: + get: + summary: List authenticators for the current identity + description: Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: listCurrentIdentityAuthenticators + parameters: + - $ref: 'parameters.yml#/limit' + - $ref: 'parameters.yml#/offset' + - $ref: 'parameters.yml#/filter' + responses: + '200': + $ref: 'authenticators.yml#/responses/listAuthenticators' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + current-identity-authenticators-id: + parameters: + - $ref: 'parameters.yml#/id' + get: + summary: Retrieve an authenticator for the current identity + description: Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: detailCurrentIdentityAuthenticator + responses: + '200': + $ref: 'authenticators.yml#/responses/detailAuthenticator' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + put: + summary: Update all fields on an authenticator of this identity + description: | + Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's + identity. + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: updateCurrentIdentityAuthenticator + parameters: + - name: authenticator + in: body + required: true + description: 'An authenticator put object' + schema: + $ref: 'authenticators.yml#/definitions/authenticatorUpdateWithCurrent' + responses: + '200': + $ref: 'standard-responses.yml#/responses/updateResponse' + '400': + $ref: 'standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + patch: + summary: Update the supplied fields on an authenticator of this identity + description: | + Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API + session's identity. + security: + - ztSession: [ ] + tags: + - Current API Session + operationId: patchCurrentIdentityAuthenticator + parameters: + - name: authenticator + in: body + required: true + description: An authenticator patch object + schema: + $ref: 'authenticators.yml#/definitions/authenticatorPatchWithCurrent' + responses: + '200': + $ref: 'standard-responses.yml#/responses/patchResponse' + '400': + $ref: 'standard-responses.yml#/responses/badRequestResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' diff --git a/specs/source/shared/current-identity-mfa.yml b/specs/source/shared/current-identity-mfa.yml new file mode 100644 index 000000000..3269be6df --- /dev/null +++ b/specs/source/shared/current-identity-mfa.yml @@ -0,0 +1,274 @@ +--- +paths: + current-identity-mfa: + post: + summary: Initiate MFA enrollment + 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` + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: enrollMfa + responses: + '201': + $ref: 'standard-responses.yml#/responses/createResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '409': + $ref: '#/responses/alreadyMfaEnrolledResponse' + get: + summary: Returns the current status of MFA enrollment + 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`. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: detailMfa + responses: + '200': + $ref: '#/responses/detailMfa' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + delete: + summary: Disable MFA for the current identity + 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//mfa`. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: deleteMfa + parameters: + - name: mfaValidation + in: body + required: false + description: 'An MFA validation request' + schema: + $ref: 'authenticate.yml#/definitions/mfaCode' + - name: mfa-validation-code + in: header + required: false + type: string + responses: + '200': + $ref: 'standard-responses.yml#/responses/emptyResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + current-identity-mfa-qr-code: + get: + summary: Show a QR code for unverified MFA enrollments + description: > + Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or + not started. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: detailMfaQrCode + produces: + - image/png + - application/json + responses: + 200: + description: OK + 404: + description: No MFA enrollment or MFA enrollment is completed + current-identity-mfa-verify: + post: + summary: Complete MFA enrollment by verifying a time based one time token + 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`. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: verifyMfa + parameters: + - name: mfaValidation + in: body + required: true + description: 'An MFA validation request' + schema: + $ref: 'authenticate.yml#/definitions/mfaCode' + responses: + '200': + $ref: 'standard-responses.yml#/responses/emptyResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + current-identity-mfa-recovery-codes: + get: + summary: For a completed MFA enrollment view the current recovery codes + 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. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: detailMfaRecoveryCodes + parameters: + - name: mfaValidation + in: body + required: false + description: 'An MFA validation request' + schema: + $ref: 'authenticate.yml#/definitions/mfaCode' + - name: mfa-validation-code + in: header + required: false + type: string + responses: + '200': + $ref: 'standard-responses.yml#/responses/emptyResponse' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + post: + summary: For a completed MFA enrollment regenerate the recovery codes + 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. + security: + - ztSession: [ ] + tags: + - Current Identity + - MFA + operationId: createMfaRecoveryCodes + parameters: + - name: mfaValidation + in: body + required: true + description: 'An MFA validation request' + schema: + $ref: 'authenticate.yml#/definitions/mfaCode' + responses: + '200': + $ref: '#/responses/detailMfaRecoveryCodes' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' + '404': + $ref: 'standard-responses.yml#/responses/notFoundResponse' + +responses: + alreadyMfaEnrolledResponse: + description: The identity is already enrolled in MFA + schema: + $ref: 'standard-responses.yml#/definitions/apiErrorEnvelope' + examples: + 'application/json': + error: + args: + cause: + causeMessage: '' + code: ALREADY_MFA_ENROLLED + message: The identity is already enrolled in MFA + requestId: 270908d6-f2ef-4577-b973-67bec18ae376 + meta: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + mfaCreatedResponse: + description: The create request was succesful and the response contains the location and details to complete MFA enrollment + schema: + $ref: '#/definitions/mfaCreatedEnvelope' + + detailMfa: + description: The details of an MFA enrollment + schema: + $ref: '#/definitions/detailMfaEnvelope' + + detailMfaRecoveryCodes: + description: The recovery codes of an MFA enrollment + schema: + $ref: '#/definitions/detailMfaRecoveryCodesEnvelope' + +definitions: + mfaFormats: + type: string + enum: + - numeric + - alpha + - alphaNumeric + mfaProviders: + type: string + enum: + - ziti + mfaCreatedEnvelope: + type: object + required: + - meta + - error + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + error: + $ref: '#/definitions/apiError' + detailMfaEnvelope: + type: object + required: + - meta + - error + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + error: + $ref: '#/definitions/detailMfa' + detailMfa: + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - required: + - isVerified + properties: + isVerified: + type: boolean + recoveryCodes: + type: array + items: + type: string + description: Not provided if MFA verification has been completed + provisioningUrl: + type: string + description: Not provided if MFA verification has been completed + detailMfaRecoveryCodesEnvelope: + type: object + required: + - meta + - error + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + error: + $ref: '#/definitions/detailMfaRecoveryCodes' + detailMfaRecoveryCodes: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - required: + - recoveryCodes + properties: + recoveryCodes: + type: array + items: + type: string \ No newline at end of file diff --git a/specs/source/shared/current-identity.yml b/specs/source/shared/current-identity.yml new file mode 100644 index 000000000..e41cf1489 --- /dev/null +++ b/specs/source/shared/current-identity.yml @@ -0,0 +1,63 @@ +--- +paths: + current-identity: + get: + summary: Return the current identity + description: Returns the identity associated with the API sessions used to issue the current request + security: + - ztSession: [ ] + tags: + - Current Identity + operationId: getCurrentIdentity + responses: + '200': + $ref: '#/responses/detailCurrentIdentity' + '401': + $ref: 'standard-responses.yml#/responses/unauthorizedResponse' +responses: + detailCurrentIdentity: + description: The identity associated with the API Session used to issue the request + schema: + $ref: '#/definitions/currentIdentityDetailEnvelope' + examples: + default: + meta: { } + data: + id: 66352d7b-a6b2-4ce9-85bb-9f18e318704d + createdAt: '2020-01-13T16:38:13.6854788Z' + updatedAt: '2020-01-13T16:38:13.6854788Z' + _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' + tags: { } + name: Default Admin + type: + urlName: identity-types + id: User + name: User + _links: + self: + href: './identity-types/User' + isDefaultAdmin: true + isAdmin: true + authenticators: + updb: + username: admin + enrollment: { } + roleAttributes: [] + +definitions: + currentIdentityDetailEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: 'identities.yml#/definitions/identityDetail' \ No newline at end of file diff --git a/specs/source/shared/edge-routers.yml b/specs/source/shared/edge-routers.yml new file mode 100644 index 000000000..23d6fca9d --- /dev/null +++ b/specs/source/shared/edge-routers.yml @@ -0,0 +1,25 @@ +--- +definitions: + commonEdgeRouterProperties: + type: object + required: + - hostname + - name + - supportedProtocols + - syncStatus + - isOnline + properties: + hostname: + type: string + name: + type: string + supportedProtocols: + additionalProperties: + type: string + type: object + syncStatus: + type: string + isOnline: + type: boolean + appData: + $ref: 'base-entity.yml#/definitions/tags' \ No newline at end of file diff --git a/specs/source/shared/identities.yml b/specs/source/shared/identities.yml new file mode 100644 index 000000000..c2776e710 --- /dev/null +++ b/specs/source/shared/identities.yml @@ -0,0 +1,124 @@ +--- + +definitions: + identityList: + description: A list of identities + type: array + items: + $ref: '#/definitions/identityDetail' + identityDetail: + description: Detail of a specific identity + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - type + - typeId + - isDefaultAdmin + - isAdmin + - authenticators + - enrollment + - envInfo + - sdkInfo + - roleAttributes + - hasEdgeRouterConnection + - hasApiSession + - isMfaEnabled + - serviceHostingPrecedences + - serviceHostingCosts + - defaultHostingCost + properties: + name: + type: string + type: + $ref: 'base-entity.yml#/definitions/entityRef' + typeId: + type: string + isDefaultAdmin: + type: boolean + isAdmin: + type: boolean + authenticators: + $ref: '#/definitions/identityAuthenticators' + enrollment: + $ref: '#/definitions/identityEnrollments' + envInfo: + $ref: 'authenticate.yml#/definitions/envInfo' + sdkInfo: + $ref: 'authenticate.yml#/definitions/sdkInfo' + roleAttributes: + $ref: 'base-entity.yml#/definitions/attributes' + hasEdgeRouterConnection: + type: boolean + hasApiSession: + type: boolean + isMfaEnabled: + type: boolean + defaultHostingPrecedence: + $ref: 'terminators.yml#/definitions/terminatorPrecedence' + defaultHostingCost: + $ref: 'terminators.yml#/definitions/terminatorCost' + serviceHostingPrecedences: + $ref: 'terminators.yml#/definitions/terminatorPrecedenceMap' + serviceHostingCosts: + $ref: 'terminators.yml#/definitions/terminatorCostMap' + appData: + $ref: 'base-entity.yml#/definitions/tags' + identityAuthenticators: + type: object + properties: + updb: + properties: + username: + type: string + type: object + cert: + type: object + properties: + fingerprint: + type: string + identityEnrollments: + type: object + properties: + updb: + type: object + properties: + id: + type: string + token: + type: string + jwt: + type: string + expiresAt: + type: string + format: date-time + ott: + type: object + properties: + id: + type: string + token: + type: string + jwt: + type: string + expiresAt: + type: string + format: date-time + ottca: + type: object + properties: + id: + type: string + token: + type: string + jwt: + type: string + caId: + type: string + ca: + $ref: 'base-entity.yml#/definitions/entityRef' + expiresAt: + type: string + format: date-time \ No newline at end of file diff --git a/specs/source/shared/parameters.yml b/specs/source/shared/parameters.yml new file mode 100644 index 000000000..18e84c826 --- /dev/null +++ b/specs/source/shared/parameters.yml @@ -0,0 +1,55 @@ +--- +id: + name: id + required: true + type: string + in: path + description: The id of the requested resource +serviceId: + name: serviceId + required: true + type: string + in: path + description: The id of a service +limit: + name: limit + type: integer + in: query +offset: + name: offset + type: integer + in: query +filter: + name: filter + type: string + in: query +token: + name: token + type: string + format: uuid + in: query + required: true +token-optional: + name: token + type: string + format: uuid + in: query +authMethod: + name: method + in: query + required: true + type: string + enum: + - password + - cert +roleFilter: + name: roleFilter + type: array + in: query + collectionFormat: multi + items: + type: string +roleSemantic: + name: roleSemantic + type: string + in: query \ No newline at end of file diff --git a/specs/source/shared/posture-checks.yml b/specs/source/shared/posture-checks.yml new file mode 100644 index 000000000..01a272f2a --- /dev/null +++ b/specs/source/shared/posture-checks.yml @@ -0,0 +1,21 @@ +--- + +definitions: + postureCheckType: + type: string + enum: + - OS + - PROCESS + - DOMAIN + - MAC + - MFA + - PROCESS_MULTI + osType: + type: string + enum: + - Windows + - WindowsServer + - Android + - iOS + - Linux + - macOS \ No newline at end of file diff --git a/specs/source/shared/posture-queries.yml b/specs/source/shared/posture-queries.yml new file mode 100644 index 000000000..0de4e5ce6 --- /dev/null +++ b/specs/source/shared/posture-queries.yml @@ -0,0 +1,49 @@ +--- + +definitions: + postureQueries: + type: object + required: + - policyId + - isPassing + - postureQueries + properties: + policyId: + type: string + isPassing: + type: boolean + policyType: + $ref: 'base-entity.yml#/definitions/dialBind' + postureQueries: + type: array + items: + $ref: '#/definitions/postureQuery' + postureQuery: + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - queryType + - isPassing + - timeout + properties: + isPassing: + type: boolean + timeout: + type: integer + queryType: + $ref: 'posture-checks.yml#/definitions/postureCheckType' + process: + $ref: '#/definitions/postureQueryProcess' + processes: + type: array + items: + $ref: '#/definitions/postureQueryProcess' + postureQueryProcess: + type: object + properties: + osType: + $ref: 'posture-checks.yml#/definitions/osType' + path: + type: string \ No newline at end of file diff --git a/specs/source/shared/services.yml b/specs/source/shared/services.yml new file mode 100644 index 000000000..e95cc9c95 --- /dev/null +++ b/specs/source/shared/services.yml @@ -0,0 +1,77 @@ +--- + +responses: + listServices: + description: A list of services + schema: + $ref: '#/definitions/listServicesEnvelope' + detailService: + description: A single service + schema: + $ref: '#/definitions/detailServiceEnvelope' + +definitions: + listServicesEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/serviceList' + detailServiceEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: '../shared/standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/serviceDetail' + serviceList: + type: array + items: + $ref: '#/definitions/serviceDetail' + serviceDetail: + type: object + allOf: + - $ref: '../shared/base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + - terminatorStrategy + - roleAttributes + - permissions + - configs + - config + - encryptionRequired + - postureQueries + properties: + name: + type: string + terminatorStrategy: + type: string + roleAttributes: + $ref: '../shared/base-entity.yml#/definitions/attributes' + permissions: + $ref: '../shared/base-entity.yml#/definitions/dialBindArray' + configs: + type: array + items: + type: string + config: + type: object + additionalProperties: + type: object + additionalProperties: + type: object + description: map of config data for this service keyed by the config type name. Only configs of the types requested will be returned. + encryptionRequired: + type: boolean + postureQueries: + type: array + items: + $ref: '../shared/posture-queries.yml#/definitions/postureQueries' \ No newline at end of file diff --git a/specs/source/shared/sessions.yml b/specs/source/shared/sessions.yml new file mode 100644 index 000000000..9c5f12616 --- /dev/null +++ b/specs/source/shared/sessions.yml @@ -0,0 +1,81 @@ +--- + +responses: + listSessions: + description: A list of sessions + schema: + $ref: '#/definitions/listSessionsEnvelope' + detailSession: + description: A single session + schema: + $ref: '#/definitions/detailSessionEnvelope' + +definitions: + listSessionsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/sessionList' + detailSessionEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/sessionDetail' + + + sessionList: + type: array + items: + $ref: '#/definitions/sessionDetail' + sessionDetail: + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - type + - apiSessionId + - apiSession + - serviceId + - service + - token + - edgeRouters + properties: + type: + $ref: 'base-entity.yml#/definitions/dialBind' + token: + type: string + apiSessionId: + type: string + apiSession: + $ref: 'base-entity.yml#/definitions/entityRef' + serviceId: + type: string + service: + $ref: 'base-entity.yml#/definitions/entityRef' + edgeRouters: + type: array + items: + $ref: '#/definitions/sessionEdgeRouter' + sessionEdgeRouter: + allOf: + - $ref: "edge-routers.yml#/definitions/commonEdgeRouterProperties" + - type: object + required: + - urls + properties: + # deprecated property, see supportedProtocols in commonEdgeRouterProperties + urls: + type: object + additionalProperties: + type: string \ No newline at end of file diff --git a/specs/source/shared/specs.yml b/specs/source/shared/specs.yml new file mode 100644 index 000000000..6003b480d --- /dev/null +++ b/specs/source/shared/specs.yml @@ -0,0 +1,105 @@ +--- + +paths: + specs: + get: + summary: Returns a list of API specs + description: Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion + security: [ ] + tags: + - Informational + operationId: listSpecs + responses: + '200': + $ref: '#/responses/listSpecs' + specs-id: + parameters: + - $ref: 'parameters.yml#/id' + get: + summary: Return a single spec resource + description: Returns single spec resource embedded within the controller for consumption/documentation/code geneartion + security: [ ] + tags: + - Informational + operationId: detailSpec + responses: + '200': + $ref: '#/responses/detailSpec' + specs-id-spec: + parameters: + - $ref: 'parameters.yml#/id' + get: + summary: Returns the spec's file + description: Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). + security: [ ] + tags: + - Informational + operationId: detailSpecBody + produces: + - text/yaml + - application/json + responses: + '200': + $ref: '#/responses/detailSpecBody' + +responses: + listSpecs: + description: A list of specifications + schema: + $ref: '#/definitions/listSpecsEnvelope' + detailSpec: + description: A single specification + schema: + $ref: '#/definitions/detailSpecEnvelope' + detailSpecBody: + description: Returns the document that represents the specification + schema: + $ref: '#/definitions/detailSpecBodyEnvelope' + +definitions: + listSpecsEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/specList' + detailSpecEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/specDetail' + detailSpecBodyEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/specBodyDetail' + specList: + type: array + items: + $ref: '#/definitions/specDetail' + specDetail: + type: object + allOf: + - $ref: 'base-entity.yml#/definitions/baseEntity' + - type: object + required: + - name + properties: + name: + type: string + specBodyDetail: + type: string \ No newline at end of file diff --git a/specs/source/shared/standard-request.yml b/specs/source/shared/standard-request.yml new file mode 100644 index 000000000..30d4d02b9 --- /dev/null +++ b/specs/source/shared/standard-request.yml @@ -0,0 +1,18 @@ +--- +definitions: + pagination: + type: object + required: + - limit + - offset + - totalCount + properties: + limit: + type: number + format: int64 + offset: + type: number + format: int64 + totalCount: + type: number + format: int64 \ No newline at end of file diff --git a/specs/source/shared/standard-responses.yml b/specs/source/shared/standard-responses.yml new file mode 100644 index 000000000..106926565 --- /dev/null +++ b/specs/source/shared/standard-responses.yml @@ -0,0 +1,224 @@ +--- +responses: + emptyResponse: + description: Base empty response + schema: + $ref: '#/definitions/empty' + deleteResponse: + description: The delete request was successful and the resource has been removed + schema: + $ref: '#/definitions/empty' + updateResponse: + description: The update request was successful and the resource has been altered + schema: + $ref: '#/definitions/empty' + patchResponse: + description: The patch request was successful and the resource has been altered + schema: + $ref: '#/definitions/empty' + createResponse: + description: The create request was successful and the resource has been added at the following location + schema: + $ref: '#/definitions/createEnvelope' + badRequestResponse: + 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: + field: '(root)' + type: required + value: + fooField: abc + fooField2: def + message: '(root): fooField3 is required' + details: + context: '(root)' + field: '(root)' + property: fooField3 + causeMessage: schema validation failed + code: COULD_NOT_VALIDATE + message: The supplied request contains an invalid document + requestId: ac6766d6-3a09-44b3-8d8a-1b541d97fdd9 + meta: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + unauthorizedResponse: + description: The currently supplied session does not have the correct access rights to request this resource + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + 'application/json': + error: + args: + urlVars: { } + cause: '' + causeMessage: '' + code: UNAUTHORIZED + message: The request could not be completed. The session is not authorized or the + credentials are invalid + requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f + meta: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + invalidAuthResponse: + 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + notFoundResponse: + description: The requested resource does not exist + schema: + $ref: '#/definitions/apiErrorEnvelope' + examples: + 'application/json': + error: + args: + urlVars: + id: 71a3000f-7dda-491a-9b90-a19f4ee6c406 + cause: + causeMessage: '' + code: NOT_FOUND + message: The resource requested was not found or is no longer available + requestId: 270908d6-f2ef-4577-b973-67bec18ae376 + meta: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + cannotDeleteReferencedResourceResponse: + 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 + rateLimitedResponse: + 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: + apiEnrolmentVersion: 0.0.1 + apiVersion: 0.0.1 +definitions: + empty: + type: object + required: + - meta + - data + properties: + meta: + $ref: '#/definitions/meta' + data: + type: object + example: { } + meta: + type: object + properties: + filterableFields: + type: array + items: + type: string + x-omitempty: true + pagination: + $ref: 'standard-request.yml#/definitions/pagination' + apiEnrolmentVersion: + type: string + apiVersion: + type: string + createEnvelope: + type: object + properties: + meta: + $ref: '#/definitions/meta' + data: + $ref: '#/definitions/createLocation' + createLocation: + type: object + properties: + _links: + $ref: 'base-entity.yml#/definitions/links' + id: + type: string + apiErrorEnvelope: + type: object + required: + - meta + - error + properties: + meta: + $ref: '#/definitions/meta' + error: + $ref: '#/definitions/apiError' + apiError: + type: object + properties: + args: + $ref: '#/definitions/apiErrorArgs' + data: + type: object + additionalProperties: true + causeMessage: + type: string + code: + type: string + message: + type: string + requestId: + type: string + cause: + $ref: '#/definitions/apiErrorCause' + apiFieldError: + type: object + properties: + reason: + type: string + field: + type: string + value: + type: string + apiErrorCause: + allOf: + - $ref: '#/definitions/apiFieldError' + - $ref: '#/definitions/apiError' + apiErrorArgs: + type: object + properties: + urlVars: + properties: { } + additionalProperties: + type: string + type: object \ No newline at end of file diff --git a/specs/source/shared/terminators.yml b/specs/source/shared/terminators.yml new file mode 100644 index 000000000..8bd0e54f3 --- /dev/null +++ b/specs/source/shared/terminators.yml @@ -0,0 +1,21 @@ +--- + +definitions: + terminatorCost: + type: integer + minimum: 0 + maximum: 65535 + terminatorPrecedence: + type: string + enum: + - default + - required + - failed + terminatorPrecedenceMap: + type: object + additionalProperties: + $ref: '#/definitions/terminatorPrecedence' + terminatorCostMap: + type: object + additionalProperties: + $ref: '#/definitions/terminatorCost' \ No newline at end of file diff --git a/specs/source/shared/version.yml b/specs/source/shared/version.yml new file mode 100644 index 000000000..5b68de276 --- /dev/null +++ b/specs/source/shared/version.yml @@ -0,0 +1,88 @@ +--- +paths: + root: + get: + summary: Returns version information + security: [ ] + tags: + - Informational + operationId: listRoot + responses: + '200': + $ref: '#/responses/listVersion' + version: + get: + summary: Returns version information + security: [ ] + tags: + - Informational + operationId: listVersion + responses: + '200': + $ref: '#/responses/listVersion' +responses: + listVersion: + description: Version information for the controller + schema: + $ref: '#/definitions/listVersionEnvelope' + +definitions: + listVersionEnvelope: + type: object + required: + - meta + - data + properties: + meta: + $ref: 'standard-responses.yml#/definitions/meta' + data: + $ref: '#/definitions/version' + version: + type: object + properties: + 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' + apiVersions: + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/definitions/apiVersion' + apiVersion: + type: object + required: + - path + properties: + version: + type: string + path: + type: string + versionInfo: + type: object + required: + - os + - version + - arch + - buildDate + - revision + properties: + os: + type: string + version: + type: string + arch: + type: string + buildDate: + type: string + revision: + type: string \ No newline at end of file diff --git a/specs/swagger.yml b/specs/swagger.yml index 6a040c817..a3b85a1d0 100644 --- a/specs/swagger.yml +++ b/specs/swagger.yml @@ -1008,6 +1008,8 @@ paths: $ref: '#/responses/listCurrentApiSessionServiceUpdates' '401': $ref: '#/responses/unauthorizedResponse' + + '/current-identity': get: summary: Return the current identity diff --git a/tests/accept_manual_start_test.go b/tests/accept_manual_start_test.go index e4bc7ff93..3bb13680f 100644 --- a/tests/accept_manual_start_test.go +++ b/tests/accept_manual_start_test.go @@ -35,9 +35,9 @@ func Test_ManualStart(t *testing.T) { t.Run("creating service and edge router", func(t *testing.T) { ctx.testContextChanged(t) - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_ha.NewFactory().GetStrategyName()) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_ha.NewFactory().GetStrategyName()) ctx.CreateEnrollAndStartEdgeRouter() @@ -54,7 +54,7 @@ func Test_ManualStart(t *testing.T) { log.Info("starting listener1") host1 := &host{} - host1.id, host1.context = ctx.AdminSession.RequireCreateSdkContext() + host1.id, host1.context = ctx.AdminManagementSession.RequireCreateSdkContext() defer host1.context.Close() listener, err := host1.context.ListenWithOptions(service.Name, &ziti.ListenOptions{ @@ -70,7 +70,7 @@ func Test_ManualStart(t *testing.T) { log.Info("starting listener2") host2 := &host{} - host2.id, host2.context = ctx.AdminSession.RequireCreateSdkContext() + host2.id, host2.context = ctx.AdminManagementSession.RequireCreateSdkContext() defer host2.context.Close() listener, err = host2.context.ListenWithOptions(service.Name, &ziti.ListenOptions{ @@ -125,7 +125,7 @@ func Test_ManualStart(t *testing.T) { } }() - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() for i := 0; i < 10; i++ { diff --git a/tests/addressable_terminators_test.go b/tests/addressable_terminators_test.go index b00c13999..02d682900 100644 --- a/tests/addressable_terminators_test.go +++ b/tests/addressable_terminators_test.go @@ -33,9 +33,9 @@ func Test_AddressableTerminators(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) ctx.CreateEnrollAndStartEdgeRouter() @@ -52,7 +52,7 @@ func Test_AddressableTerminators(t *testing.T) { host := &host{} hosts = append(hosts, host) - host.id, host.context = ctx.AdminSession.RequireCreateSdkContext() + host.id, host.context = ctx.AdminManagementSession.RequireCreateSdkContext() defer host.context.Close() host.listener, err = host.context.ListenWithOptions(service.Name, &ziti.ListenOptions{ @@ -72,7 +72,7 @@ func Test_AddressableTerminators(t *testing.T) { for i := 0; i < 3; i++ { client := &client{} clients = append(clients, client) - client.id, client.context = ctx.AdminSession.RequireCreateSdkContext() + client.id, client.context = ctx.AdminManagementSession.RequireCreateSdkContext() defer client.context.Close() } @@ -117,9 +117,9 @@ func Test_AddressableTerminatorSameIdentity(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) ctx.CreateEnrollAndStartEdgeRouter() @@ -131,7 +131,7 @@ func Test_AddressableTerminatorSameIdentity(t *testing.T) { } } - identity, context := ctx.AdminSession.RequireCreateSdkContext() + identity, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.ListenWithOptions(service.Name, &ziti.ListenOptions{ @@ -163,9 +163,9 @@ func Test_AddressableTerminatorDifferentIdentity(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) ctx.CreateEnrollAndStartEdgeRouter() @@ -177,7 +177,7 @@ func Test_AddressableTerminatorDifferentIdentity(t *testing.T) { } } - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.ListenWithOptions(service.Name, &ziti.ListenOptions{ @@ -188,7 +188,7 @@ func Test_AddressableTerminatorDifferentIdentity(t *testing.T) { ctx.Req.NoError(err) defer func() { _ = listener.Close() }() - _, context2 := ctx.AdminSession.RequireCreateSdkContext() + _, context2 := ctx.AdminManagementSession.RequireCreateSdkContext() defer context2.Close() listener2, err := context2.ListenWithOptions(service.Name, &ziti.ListenOptions{ diff --git a/tests/api_error_test.go b/tests/api_error_test.go index d39eb5cc7..a788e41c0 100644 --- a/tests/api_error_test.go +++ b/tests/api_error_test.go @@ -33,7 +33,7 @@ func Test_Api_Errors(t *testing.T) { ctx.testContextChanged(t) madeUpToken := uuid.New().String() - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). //no accept header set Post("enroll?token=" + madeUpToken) @@ -51,7 +51,7 @@ func Test_Api_Errors(t *testing.T) { ctx.testContextChanged(t) madeUpToken := uuid.New().String() - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "*/*"). Post("enroll?token=" + madeUpToken) @@ -69,7 +69,7 @@ func Test_Api_Errors(t *testing.T) { ctx.testContextChanged(t) madeUpToken := uuid.New().String() - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "application/json"). Post("enroll?token=" + madeUpToken) @@ -87,7 +87,7 @@ func Test_Api_Errors(t *testing.T) { ctx.testContextChanged(t) madeUpToken := uuid.New().String() - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "appliaction/x-pem-file, application/json"). Post("enroll?token=" + madeUpToken) @@ -106,7 +106,7 @@ func Test_Api_Errors(t *testing.T) { ctx.testContextChanged(t) madeUpToken := uuid.New().String() - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "application/x-pem-file"). Post("enroll?token=" + madeUpToken) diff --git a/tests/api_session_certificates_test.go b/tests/api_session_certificates_test.go index 0a51bbe83..10fb5b233 100644 --- a/tests/api_session_certificates_test.go +++ b/tests/api_session_certificates_test.go @@ -44,21 +44,22 @@ func Test_Api_Session_Certs(t *testing.T) { t.Run("can be created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() + ctx.RequireAdminClientApiLogin() csr, _, err := generateCsr() ctx.Req.NoError(err) csrPem := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE REQUEST", Bytes: csr}) ctx.Req.NotEmpty(csrPem) - request := ctx.AdminSession.newAuthenticatedRequest() + request := ctx.AdminClientSession.newAuthenticatedRequest() body := gabs.New() body.Set(string(csrPem), "csr") bodyStr := body.String() request.SetBody(bodyStr) - resp, err := request.Post("/current-api-session/certificates") + resp, err := request.Post("current-api-session/certificates") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusCreated, t) @@ -83,7 +84,7 @@ func Test_Api_Session_Certs(t *testing.T) { t.Run("can be listed", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/current-api-session/certificates") + resp, err := ctx.AdminClientSession.newAuthenticatedRequest().Get("current-api-session/certificates") ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -127,7 +128,7 @@ func Test_Api_Session_Certs(t *testing.T) { t.Run("can be detailed", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/current-api-session/certificates/" + createdId) + resp, err := ctx.AdminClientSession.newAuthenticatedRequest().Get("current-api-session/certificates/" + createdId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -166,7 +167,7 @@ func Test_Api_Session_Certs(t *testing.T) { t.Run("can be deleted", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Delete("/current-api-session/certificates/" + createdId) + resp, err := ctx.AdminClientSession.newAuthenticatedRequest().Delete("current-api-session/certificates/" + createdId) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) diff --git a/tests/api_session_test.go b/tests/api_session_test.go index 9cf59b19b..e67b5b3c3 100644 --- a/tests/api_session_test.go +++ b/tests/api_session_test.go @@ -29,17 +29,17 @@ func Test_ApiSession(t *testing.T) { defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("config types should be set and viewable", func(t *testing.T) { - configType1 := ctx.AdminSession.requireCreateNewConfigType() - configType2 := ctx.AdminSession.requireCreateNewConfigType() + configType1 := ctx.AdminManagementSession.requireCreateNewConfigType() + configType2 := ctx.AdminManagementSession.requireCreateNewConfigType() - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) auth.ConfigTypes = s(configType1.Id, configType2.Name) - session, err := auth.Authenticate(ctx) + session, err := auth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) expected := s(configType1.Id, configType2.Id) diff --git a/tests/auth_cert_test.go b/tests/auth_cert_test.go index 33dcd7faf..fbe4bdc42 100644 --- a/tests/auth_cert_test.go +++ b/tests/auth_cert_test.go @@ -25,7 +25,7 @@ import ( "github.com/Jeffail/gabs" "github.com/openziti/edge/controller/model" "github.com/openziti/foundation/common/constants" - nfpem "github.com/openziti/foundation/util/pem" + nfPem "github.com/openziti/foundation/util/pem" "github.com/stretchr/testify/require" "net/http" "reflect" @@ -37,9 +37,9 @@ func Test_Authenticate_Cert(t *testing.T) { defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - _, certAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment("test", false) + _, certAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment("test", false) var tests = &authCertTests{ ctx: ctx, @@ -99,7 +99,7 @@ func (test *authCertTests) testAuthenticateCertStoresAndFillsFullCert(t *testing r.Empty(certAuth.Pem, "cert authenticator pem was not set to empty/blank") - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = test.certAuthenticator.TLSCertificates() resp, err := testClient.NewRequest(). @@ -121,7 +121,7 @@ func (test *authCertTests) testAuthenticateCertStoresAndFillsFullCert(t *testing } func (test *authCertTests) testAuthenticateValidCertEmptyBody(t *testing.T) { - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = test.certAuthenticator.TLSCertificates() resp, err := testClient.NewRequest(). @@ -173,7 +173,7 @@ func (test *authCertTests) testAuthenticateValidCertEmptyBody(t *testing.T) { } func (test *authCertTests) testAuthenticateValidCertValidClientInfoBody(t *testing.T) { - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = test.certAuthenticator.TLSCertificates() @@ -249,7 +249,7 @@ func (test *authCertTests) testAuthenticateValidCertValidClientInfoBody(t *testi token := data.Path("data.token").Data().(string) r.NotEmpty(token) - resp, err := test.ctx.AdminSession.newRequest(test.ctx).Get("identities/" + identityId) + resp, err := test.ctx.AdminManagementSession.NewRequest().Get("identities/" + identityId) r.NoError(err) r.Equal(http.StatusOK, resp.StatusCode()) @@ -290,7 +290,7 @@ func (test *authCertTests) testAuthenticateValidCertValidClientInfoBody(t *testi identityId := authData.Path("data.identity.id").Data().(string) - resp, err := test.ctx.AdminSession.newRequest(test.ctx).Get("identities/" + identityId) + resp, err := test.ctx.AdminManagementSession.NewRequest().Get("identities/" + identityId) r.NoError(err) r.Equal(http.StatusOK, resp.StatusCode()) @@ -313,7 +313,7 @@ func (test *authCertTests) testAuthenticateValidCertValidClientInfoBody(t *testi } func (test *authCertTests) testAuthenticateValidCertInvalidJson(t *testing.T) { - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = test.certAuthenticator.TLSCertificates() @@ -335,7 +335,7 @@ func (test *authCertTests) testAuthenticateValidCertInvalidJson(t *testing.T) { } func (test *authCertTests) testAuthenticateValidCertValidClientInfoWithExtraProperties(t *testing.T) { - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = test.certAuthenticator.TLSCertificates() @@ -357,7 +357,7 @@ func (test *authCertTests) testAuthenticateValidCertValidClientInfoWithExtraProp func (test *authCertTests) testAuthenticateInvalidCert(t *testing.T) { r := require.New(t) - testClient, _, transport := test.ctx.NewClientComponents() + testClient, _, transport := test.ctx.NewClientComponents(EdgeClientApiPath) certAndKeyPem := `-----BEGIN CERTIFICATE----- MIICyjCCAlCgAwIBAgIRAMbo6szcFH+1lrByi/UvSiMwCgYIKoZIzj0EAwIwZDEL @@ -386,7 +386,7 @@ cX4Z8geM01kbXIDHiPhb6hQXpBSPYooYDUFTENRHSFs/U4c3xCyltrZw4bPn2GOx rv1CXRECfHglY+vO0CFumQOV5bec2R8= -----END EC PRIVATE KEY-----` - blocks := nfpem.DecodeAll([]byte(certAndKeyPem)) + blocks := nfPem.DecodeAll([]byte(certAndKeyPem)) r.Len(blocks, 3, "cert & key pair pem blocks did not parse, expected 2 blocks, got: %d", len(blocks)) cert, err := x509.ParseCertificate(blocks[0].Bytes) diff --git a/tests/auth_perf_test.go b/tests/auth_perf_test.go index 481d7bfaf..ad0266d64 100644 --- a/tests/auth_perf_test.go +++ b/tests/auth_perf_test.go @@ -35,7 +35,7 @@ func Test_AuthPerformance(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() reg := metrics.NewRegistry() histogram := newHistogram() @@ -45,8 +45,8 @@ func Test_AuthPerformance(t *testing.T) { go metrics.Write(reg, 5*time.Second, os.Stdout) - identity := ctx.AdminSession.RequireNewIdentityWithOtt(false) - config := ctx.AdminSession.testContext.EnrollIdentity(identity.Id) + identity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) + config := ctx.AdminManagementSession.testContext.EnrollIdentity(identity.Id) context := ziti.NewContextWithConfig(config) _, _ = context.GetServices() @@ -83,7 +83,7 @@ func Test_CombinedSessionCreatePerformance(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() reg := metrics.NewRegistry() apiSessionCreateHistogram := newHistogram() @@ -100,8 +100,8 @@ func Test_CombinedSessionCreatePerformance(t *testing.T) { ctx.CreateEnrollAndStartEdgeRouter() - identity := ctx.AdminSession.RequireNewIdentityWithOtt(false) - config := ctx.AdminSession.testContext.EnrollIdentity(identity.Id) + identity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) + config := ctx.AdminManagementSession.testContext.EnrollIdentity(identity.Id) context := ziti.NewContextWithConfig(config) _, _ = context.GetServices() @@ -117,7 +117,7 @@ func Test_CombinedSessionCreatePerformance(t *testing.T) { _, err = client.Login(info) ctx.Req.NoError(err) - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") for i := 0; i < 25; i++ { go func() { @@ -149,7 +149,7 @@ func Test_SessionCreatePerformance(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() reg := metrics.NewRegistry() histogram := newHistogram() @@ -161,9 +161,9 @@ func Test_SessionCreatePerformance(t *testing.T) { ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") - identity := ctx.AdminSession.RequireNewIdentityWithOtt(false) - config := ctx.AdminSession.testContext.EnrollIdentity(identity.Id) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") + identity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) + config := ctx.AdminManagementSession.testContext.EnrollIdentity(identity.Id) context := ziti.NewContextWithConfig(config) _, _ = context.GetServices() diff --git a/tests/auth_updb_test.go b/tests/auth_updb_test.go index 0784737e2..8d4009ccd 100644 --- a/tests/auth_updb_test.go +++ b/tests/auth_updb_test.go @@ -52,10 +52,10 @@ func (tests *authUpdbTests) testAuthenticateUpdbInvalidPassword(t *testing.T) { _, _ = body.SetP(tests.ctx.AdminAuthenticator.Username, "username") _, _ = body.SetP("invalid_password", "password") - resp, err := tests.ctx.DefaultClient().R(). + resp, err := tests.ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") t.Run("should not have returned an error", func(t *testing.T) { require.New(t).NoError(err) @@ -73,10 +73,10 @@ func (tests *authUpdbTests) testAuthenticateUpdbInvalidUsername(t *testing.T) { _, _ = body.SetP("weeewoooweeewooo123", "username") _, _ = body.SetP("admin", "password") - resp, err := tests.ctx.DefaultClient().R(). + resp, err := tests.ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") t.Run("should not have returned an error", func(t *testing.T) { require.New(t).NoError(err) @@ -93,10 +93,10 @@ func (tests *authUpdbTests) testAuthenticateUPDBMissingPassword(t *testing.T) { body := gabs.New() _, _ = body.SetP(tests.ctx.AdminAuthenticator.Username, "username") - resp, err := tests.ctx.DefaultClient().R(). + resp, err := tests.ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") t.Run("should not have returned an error", func(t *testing.T) { require.New(t).NoError(err) @@ -113,10 +113,10 @@ func (tests *authUpdbTests) testAuthenticateUPDBMissingUsername(t *testing.T) { body := gabs.New() _, _ = body.SetP(tests.ctx.AdminAuthenticator.Password, "password") - resp, err := tests.ctx.DefaultClient().R(). + resp, err := tests.ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") if err != nil { t.Errorf("failed to authenticate via UPDB as default admin: %s", err) @@ -138,10 +138,10 @@ func (tests *authUpdbTests) testAuthenticateUPDBDefaultAdminSuccess(t *testing.T _, _ = body.SetP(tests.ctx.AdminAuthenticator.Username, "username") _, _ = body.SetP(tests.ctx.AdminAuthenticator.Password, "password") - resp, err := tests.ctx.DefaultClient().R(). + resp, err := tests.ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") t.Run("should not have returned an error", func(t *testing.T) { require.New(t).NoError(err) diff --git a/tests/authenticate.go b/tests/authenticate.go index ad6bff3a1..4c994a6b1 100644 --- a/tests/authenticate.go +++ b/tests/authenticate.go @@ -39,19 +39,60 @@ import ( ) type authenticator interface { - Authenticate(ctx *TestContext) (*session, error) + Authenticate(ctx *TestContext, apiPath string) (*session, error) + RequireAuthenticate(ctx *TestContext, apiPath string) *session + + AuthenticateManagementApi(ctx *TestContext) (*session, error) + RequireAuthenticateManagementApi(ctx *TestContext) *session + + AuthenticateClientApi(ctx *TestContext) (*session, error) + RequireAuthenticateClientApi(ctx *TestContext) *session } +const ( + EdgeClientApiPath = "/edge/client/v1" + EdgeManagementApiPath = "/edge/management/v1" +) + +var _ authenticator = &certAuthenticator{} + type certAuthenticator struct { cert *x509.Certificate key crypto.PrivateKey certPem string } -func (authenticator *certAuthenticator) Authenticate(ctx *TestContext) (*session, error) { +func (authenticator *certAuthenticator) RequireAuthenticateManagementApi(ctx *TestContext) *session { + session, err := authenticator.AuthenticateManagementApi(ctx) + ctx.Req.NoError(err) + return session +} + +func (authenticator *certAuthenticator) AuthenticateManagementApi(ctx *TestContext) (*session, error) { + return authenticator.Authenticate(ctx, EdgeManagementApiPath) +} + +func (authenticator *certAuthenticator) RequireAuthenticateClientApi(ctx *TestContext) *session { + session, err := authenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err) + return session +} + +func (authenticator *certAuthenticator) AuthenticateClientApi(ctx *TestContext) (*session, error) { + return authenticator.Authenticate(ctx, EdgeClientApiPath) +} + +func (authenticator *certAuthenticator) RequireAuthenticate(ctx *TestContext, apiPath string) *session { + session, err := authenticator.Authenticate(ctx, apiPath) + ctx.Req.NoError(err) + return session +} + +func (authenticator *certAuthenticator) Authenticate(ctx *TestContext, apiPath string) (*session, error) { sess := &session{ authenticator: authenticator, testContext: ctx, + apiPath: apiPath, } sess.authenticatedRequests = authenticatedRequests{ @@ -59,19 +100,25 @@ func (authenticator *certAuthenticator) Authenticate(ctx *TestContext) (*session session: sess, } - transport := ctx.Transport() + transport := ctx.NewTransport() transport.TLSClientConfig.Certificates = []tls.Certificate{ { Certificate: [][]byte{authenticator.cert.Raw}, PrivateKey: authenticator.key, }, } - client := ctx.Client(ctx.HttpClient(transport)) - client.SetHostURL("https://" + ctx.ApiHost) + sess.client = resty.NewWithClient(ctx.NewHttpClient(transport)) - resp, err := client.R(). + resolvedUrl, err := sess.resolveApiUrl(ctx.ApiHost, apiPath) + if err != nil { + return nil, err + } + + sess.client.SetHostURL(resolvedUrl) + + resp, err := sess.client.R(). SetHeader("content-type", "application/json"). - Post("/authenticate?method=cert") + Post("authenticate?method=cert") if err != nil { return nil, errors.Errorf("failed to authenticate via CERT: %s", err) @@ -101,16 +148,49 @@ func (authenticator *certAuthenticator) Fingerprint() string { return cert.NewFingerprintGenerator().FromRaw(authenticator.cert.Raw) } +var _ authenticator = &updbAuthenticator{} + type updbAuthenticator struct { Username string Password string ConfigTypes []string } -func (authenticator *updbAuthenticator) Authenticate(ctx *TestContext) (*session, error) { +func (authenticator *updbAuthenticator) RequireAuthenticateManagementApi(ctx *TestContext) *session { + session, err := authenticator.AuthenticateManagementApi(ctx) + ctx.Req.NoError(err) + + return session +} + +func (authenticator *updbAuthenticator) AuthenticateManagementApi(ctx *TestContext) (*session, error) { + return authenticator.Authenticate(ctx, EdgeManagementApiPath) +} + +func (authenticator *updbAuthenticator) RequireAuthenticateClientApi(ctx *TestContext) *session { + session, err := authenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err) + + return session +} + +func (authenticator *updbAuthenticator) AuthenticateClientApi(ctx *TestContext) (*session, error) { + return authenticator.Authenticate(ctx, EdgeClientApiPath) +} + +func (authenticator *updbAuthenticator) RequireAuthenticate(ctx *TestContext, apiPath string) *session { + session, err := authenticator.Authenticate(ctx, apiPath) + ctx.Req.NoError(err) + + return session +} + +func (authenticator *updbAuthenticator) Authenticate(ctx *TestContext, apiPath string) (*session, error) { sess := &session{ authenticator: authenticator, testContext: ctx, + apiPath: apiPath, + client: ctx.NewRestClientWithDefaults(), } sess.authenticatedRequests = authenticatedRequests{ @@ -118,6 +198,13 @@ func (authenticator *updbAuthenticator) Authenticate(ctx *TestContext) (*session session: sess, } + resolvedUrl, err := sess.resolveApiUrl(ctx.ApiHost, apiPath) + if err != nil { + return nil, err + } + + sess.client.SetHostURL(resolvedUrl) + body := gabs.New() _, _ = body.SetP(authenticator.Username, "username") _, _ = body.SetP(authenticator.Password, "password") @@ -125,10 +212,10 @@ func (authenticator *updbAuthenticator) Authenticate(ctx *TestContext) (*session _, _ = body.SetP(authenticator.ConfigTypes, "configTypes") } - resp, err := ctx.DefaultClient().R(). + resp, err := sess.client.R(). SetHeader("content-type", "application/json"). SetBody(body.String()). - Post("/authenticate?method=password") + Post("authenticate?method=password") if err != nil { return nil, errors.Errorf("failed to authenticate via UPDB as %v: %s", authenticator, err) @@ -154,15 +241,81 @@ type session struct { lastServiceUpdate time.Time configTypes []string testContext *TestContext + baseUrl string authenticatedRequests + apiPath string + client *resty.Client } -func (sess *session) newRequest(ctx *TestContext) *resty.Request { - req := ctx.newRequest() - if sess.token != "" { - req.SetHeader(constants.ZitiSession, sess.token) +// Clone allows a session to be cloned with a new internal Resty Client that targets another API. Useful for +// cross API security testing. Clone does not authenticate. It attempts to use the token in the source +// session. If the session is not authenticated, then the cloned result is not authenticated as well. +func (sess *session) Clone(ctx *TestContext, apiPath string) (*session, error) { + clone := &session{ + authenticator: sess.authenticator, + id: sess.id, + token: sess.token, + identityId: sess.identityId, + createdAt: sess.createdAt, + lastServiceUpdate: sess.lastServiceUpdate, + configTypes: sess.configTypes, + testContext: sess.testContext, + baseUrl: sess.baseUrl, + apiPath: apiPath, + client: resty.NewWithClient(sess.client.GetClient()), } - return req + + clone.authenticatedRequests = authenticatedRequests{ + testContext: ctx, + session: clone, + } + + resolvedUrl, err := sess.resolveApiUrl(ctx.ApiHost, apiPath) + + if err != nil { + return nil, err + } + + clone.client.SetHostURL(resolvedUrl) + + return clone, nil +} + +// CloneToClientApi is a helper function to clone a session (most likely from the Management API) to the Client API. +// See Clone for details. +func (sess *session) CloneToClientApi(ctx *TestContext) (*session, error) { + return sess.Clone(ctx, EdgeClientApiPath) +} + +// CloneToManagementApi is a helper function to clone a session (most likely from the Client API) to the Management API. +// See Clone for details. +func (sess *session) CloneToManagementApi(ctx *TestContext) (*session, error) { + return sess.Clone(ctx, EdgeManagementApiPath) +} + +func (sess *session) NewRequest() *resty.Request { + sess.client.R() + return sess.client.R().SetHeader(constants.ZitiSession, sess.token) +} + +// resolveApiUrl takes a URL prefix, apiHost, in the format of "https://domain:port" and joins +// it with apiPath. apiPath may be a relative path. +func (sess *session) resolveApiUrl(apiHost string, apiPath string) (string, error) { + hostUrl, err := url.Parse("https://" + apiHost) + + if err != nil { + return "", err + } + + pathUrl, err := url.Parse(apiPath) + + if err != nil { + return "", err + } + + resolvedUrl := hostUrl.ResolveReference(pathUrl) + + return resolvedUrl.String(), nil } func (sess *session) parseSessionInfoFromResponse(ctx *TestContext, response *resty.Response) error { @@ -210,7 +363,7 @@ func (sess *session) parseSessionInfoFromResponse(ctx *TestContext, response *re } func (sess *session) logout() error { - resp, err := sess.newRequest(sess.testContext).Delete("/current-api-session") + resp, err := sess.NewRequest().Delete("current-api-session") if err != nil { return err @@ -229,11 +382,11 @@ type authenticatedRequests struct { } func (request *authenticatedRequests) newAuthenticatedRequest() *resty.Request { - return request.session.newRequest(request.testContext) + return request.session.NewRequest().SetHeader("content-type", "application/json") } -func (request *authenticatedRequests) newAuthenticatedJsonRequest(body interface{}) *resty.Request { - return request.session.newRequest(request.testContext). +func (request *authenticatedRequests) newAuthenticatedRequestWithBody(body interface{}) *resty.Request { + return request.session.NewRequest(). SetHeader("content-type", "application/json"). SetBody(body) } @@ -280,7 +433,7 @@ func (request *authenticatedRequests) requireNewPostureResponseDomain(postureChe resp, err := request.newAuthenticatedRequest(). SetBody(entityJson). - Post("/posture-response") + Post("posture-response") request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) @@ -300,7 +453,7 @@ func (request *authenticatedRequests) requireNewPostureResponseBulkDomain(postur resp, err := request.newAuthenticatedRequest(). SetBody(entityJson). - Post("/posture-response-bulk") + Post("posture-response-bulk") request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) @@ -331,7 +484,7 @@ func (request *authenticatedRequests) createNewSession(serviceId string) (*resty return request.newAuthenticatedRequest(). SetBody(entityJson). - Post("/sessions") + Post("sessions") } func (request *authenticatedRequests) requireCreateIdentityWithUpdbEnrollment(name string, password string, isAdmin bool, rolesAttributes ...string) (*identity, *updbAuthenticator) { @@ -559,7 +712,7 @@ func (request *authenticatedRequests) requireCreateRestModelPostureResponse(enti body, err := entity.MarshalJSON() request.testContext.Req.NoError(err) - resp, err := request.newAuthenticatedRequest().SetBody(body).Post("/posture-response") + resp, err := request.newAuthenticatedRequest().SetBody(body).Post("posture-response") request.testContext.Req.NoError(err) standardJsonResponseTests(resp, http.StatusCreated, request.testContext.testing) @@ -624,7 +777,7 @@ func (request *authenticatedRequests) requireRemoveAssociation(url string, ids . func (request *authenticatedRequests) createEntityOfType(entityType string, body interface{}) *resty.Response { resp, err := request.newAuthenticatedRequest(). SetBody(body). - Post("/" + entityType) + Post(entityType) request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) @@ -695,7 +848,7 @@ func (request *authenticatedRequests) updateIdentityServiceConfigs(method string req.SetBody(body) } - resp, err := req.Execute(method, "/identities/"+identityId+"/service-configs") + resp, err := req.Execute(method, "identities/"+identityId+"/service-configs") request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) @@ -707,7 +860,7 @@ func (request *authenticatedRequests) createEntity(entity entity) *resty.Respons } func (request *authenticatedRequests) deleteEntityOfType(entityType string, id string) *resty.Response { - resp, err := request.newAuthenticatedRequest().Delete("/" + entityType + "/" + id) + resp, err := request.newAuthenticatedRequest().Delete(entityType + "/" + id) request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) @@ -724,7 +877,7 @@ func (request *authenticatedRequests) updateEntityOfType(id string, entityType s pfxlog.Logger().Tracef("update body:\n%v\n", body) } - urlPath := fmt.Sprintf("/%v/%v", entityType, id) + urlPath := fmt.Sprintf("%v/%v", entityType, id) pfxlog.Logger().Infof("url path: %v", urlPath) updateRequest := request.newAuthenticatedRequest().SetBody(body) @@ -744,7 +897,7 @@ func (request *authenticatedRequests) updateEntityOfType(id string, entityType s } func (request *authenticatedRequests) query(url string) (int, []byte) { - resp, err := request.newAuthenticatedRequest().Get("/" + url) + resp, err := request.newAuthenticatedRequest().Get(url) request.testContext.Req.NoError(err) return resp.StatusCode(), resp.Body() } @@ -809,7 +962,7 @@ func (request *authenticatedRequests) updateAssociation(method, url string, ids resp, err := request.newAuthenticatedRequest(). SetBody(request.testContext.idsJson(ids...).String()). - Execute(method, "/"+url) + Execute(method, url) request.testContext.Req.NoError(err) request.testContext.logJson(resp.Body()) return resp.StatusCode(), resp.Body() @@ -822,11 +975,20 @@ func (request *authenticatedRequests) isServiceVisibleToUser(serviceId string) b return nil != request.testContext.childWith(data, "id", serviceId) } -func (request *authenticatedRequests) createUserAndLogin(isAdmin bool, roleAttributes, configTypes []string) *session { +func (request *authenticatedRequests) createUserAndLoginClientApi(isAdmin bool, roleAttributes, configTypes []string) *session { _, userAuth := request.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), isAdmin, roleAttributes...) userAuth.ConfigTypes = configTypes - session, _ := userAuth.Authenticate(request.testContext) + session, _ := userAuth.AuthenticateClientApi(request.testContext) + + return session +} + +func (request *authenticatedRequests) createUserAndLoginManagementApi(isAdmin bool, roleAttributes, configTypes []string) *session { + _, userAuth := request.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), isAdmin, roleAttributes...) + userAuth.ConfigTypes = configTypes + + session, _ := userAuth.AuthenticateManagementApi(request.testContext) return session } @@ -852,8 +1014,8 @@ func (request *authenticatedRequests) requireServiceUpdateTimeAdvanced() { } func (request *authenticatedRequests) getServiceUpdateTime() time.Time { - json := request.requireQuery("current-api-session/service-updates") - lastChanged := request.testContext.requireString(json, "data", "lastChangeAt") + respBody := request.requireQuery("current-api-session/service-updates") + lastChanged := request.testContext.requireString(respBody, "data", "lastChangeAt") t, err := time.Parse(time.RFC3339, lastChanged) request.testContext.Req.NoError(err) return t diff --git a/tests/authenticator_test.go b/tests/authenticator_test.go index 55d41d307..5cc3edaaf 100644 --- a/tests/authenticator_test.go +++ b/tests/authenticator_test.go @@ -33,14 +33,14 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - _, _ = ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - _, _ = ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) + _, _ = ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + _, _ = ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) t.Run("can list authenticators", func(t *testing.T) { req := require.New(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/authenticators") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/authenticators") req.NoError(err) @@ -59,7 +59,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { }) t.Run("can show details of an authenticator", func(t *testing.T) { req := require.New(t) - listResp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/authenticators") + listResp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/authenticators") req.NoError(err) @@ -72,7 +72,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { authenticatorId := authenticatorsBody.Path("data").Index(0).Path("id").Data().(string) req.NotEmpty(authenticatorId) - detailResp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/authenticators/" + authenticatorId) + detailResp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/authenticators/" + authenticatorId) standardJsonResponseTests(detailResp, http.StatusOK, t) }) @@ -80,7 +80,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("can create updb authenticator for a different identity", func(t *testing.T) { ctx.testContextChanged(t) - identityId := ctx.AdminSession.requireCreateIdentity(eid.New(), false) + identityId := ctx.AdminManagementSession.requireCreateIdentity(eid.New(), false) username := eid.New() password := eid.New() @@ -90,7 +90,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { _, _ = body.Set(username, "username") _, _ = body.Set(password, "password") - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(body.String()).Post("/authenticators") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(body.String()).Post("/authenticators") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusCreated, t) @@ -103,7 +103,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { ConfigTypes: nil, } - session, err := authenticator.Authenticate(ctx) + session, err := authenticator.AuthenticateClientApi(ctx) req.NoError(err) req.NotEmpty(session.id) @@ -114,7 +114,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot create a updb authenticator for an identity with an existing updb authenticator", func(t *testing.T) { ctx.testContextChanged(t) - identity, _ := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + identity, _ := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) username := eid.New() password := eid.New() @@ -125,7 +125,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { _, _ = body.Set(username, "username") _, _ = body.Set(password, "password") - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(body.String()).Post("/authenticators") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(body.String()).Post("/authenticators") ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, apierror.AuthenticatorMethodMaxCode, apierror.AuthenticatorMethodMaxStatus, t) @@ -134,9 +134,9 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("can update updb authenticator for a different identity", func(t *testing.T) { ctx.testContextChanged(t) - identity, _ := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + identity, _ := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - result, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) + result, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) ctx.Req.NoError(err) resultBody, err := gabs.ParseJSON(result.Body()) @@ -156,7 +156,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { _, _ = body.Set(newPassword, "password") - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(body.String()).Put("/authenticators/" + authenticatorId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(body.String()).Put("/authenticators/" + authenticatorId) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -170,7 +170,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { ConfigTypes: nil, } - session, err := auth.Authenticate(ctx) + session, err := auth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(session) }) @@ -178,9 +178,9 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("can patch updb authenticator for a different identity", func(t *testing.T) { t.Run("when patching username only", func(t *testing.T) { ctx.testContextChanged(t) - identity, authenticator := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + identity, authenticator := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - result, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) + result, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) ctx.Req.NoError(err) resultBody, err := gabs.ParseJSON(result.Body()) @@ -197,7 +197,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { body := gabs.New() _, _ = body.Set(newUsername, "username") - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(body.String()).Patch("/authenticators/" + authenticatorId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(body.String()).Patch("/authenticators/" + authenticatorId) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -207,7 +207,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { authenticator.Username = newUsername - session, err := authenticator.Authenticate(ctx) + session, err := authenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(session) }) @@ -215,9 +215,9 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("when patching password only", func(t *testing.T) { ctx.testContextChanged(t) - identity, authenticator := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + identity, authenticator := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - result, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) + result, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) ctx.Req.NoError(err) resultBody, err := gabs.ParseJSON(result.Body()) @@ -234,7 +234,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { body := gabs.New() _, _ = body.Set(newPassword, "password") - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(body.String()).Patch("/authenticators/" + authenticatorId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(body.String()).Patch("/authenticators/" + authenticatorId) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -244,7 +244,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { authenticator.Password = newPassword - session, err := authenticator.Authenticate(ctx) + session, err := authenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(session) }) @@ -253,9 +253,9 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { }) t.Run("can delete updb authenticator for a different identity", func(t *testing.T) { ctx.testContextChanged(t) - identity, authenticator := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + identity, authenticator := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - result, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) + result, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf(`/authenticators?filter=identity="%s"`, identity.Id)) ctx.Req.NoError(err) resultBody, err := gabs.ParseJSON(result.Body()) @@ -267,7 +267,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { authenticatorId := idContainer.Data().(string) ctx.Req.NotEmpty(authenticatorId) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Delete("/authenticators/" + authenticatorId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Delete("/authenticators/" + authenticatorId) ctx.Req.NoError(err) @@ -275,7 +275,7 @@ func Test_Authenticators_AdminUsingAdminEndpoints(t *testing.T) { t.Run("identity can not longer authenticate", func(t *testing.T) { ctx.testContextChanged(t) - session, err := authenticator.Authenticate(ctx) + session, err := authenticator.AuthenticateClientApi(ctx) ctx.Req.Error(err) ctx.Req.Empty(session) @@ -287,32 +287,34 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - updbNonAdminUser, updbNonAdminUserAuthenticator := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - updbNonAdminSession, err := updbNonAdminUserAuthenticator.Authenticate(ctx) + updbNonAdminUser, updbNonAdminUserAuthenticator := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + updbNonAdminClientSession, err := updbNonAdminUserAuthenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err, "expected no error during non-admin updb authentication") - if err != nil { - ctx.Req.NoError(err, "expected no error during non-admin updb authentication") - } + updbNonAdminManagementSession, err := updbNonAdminClientSession.CloneToManagementApi(ctx) + ctx.Req.NoError(err) - certNonAdminUserId, certNonAdminUserAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) - certNonAdminUserSession, err := certNonAdminUserAuthenticator.Authenticate(ctx) + certNonAdminUserId, certNonAdminUserAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) + certNonAdminUserClientSession, err := certNonAdminUserAuthenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err) - if err != nil { - ctx.Req.NoError(err, "expected no error during non-admin cert authentication") - } + certNonAdminManagementSession, err := certNonAdminUserClientSession.CloneToManagementApi(ctx) + ctx.Req.NoError(err, "expected no error during non-admin cert authentication") t.Run("cannot list authenticators, receives unauthorized error", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest().Get("/authenticators") + ctx.Req.NoError(err) + + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest().Get("authenticators") req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) }) t.Run("cannot show details of an authenticator, receives unauthorized error", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest().Get("/authenticators/ba3d3a94-47aa-4be1-bc89-04877d5d5fe4") + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest().Get("authenticators/ba3d3a94-47aa-4be1-bc89-04877d5d5fe4") req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -320,7 +322,7 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot create updb authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest(). + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]interface{}{ "identityId": certNonAdminUserId, @@ -328,7 +330,7 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { "password": eid.New(), "username": eid.New(), }). - Post("/authenticators") + Post("authenticators") req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -336,13 +338,13 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot update updb authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest(). + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]interface{}{ "password": eid.New(), "username": eid.New(), }). - Put("/authenticators/" + eid.New()) + Put("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -350,12 +352,12 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot patch updb authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest(). + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]interface{}{ "password": eid.New(), }). - Patch("/authenticators/" + eid.New()) + Patch("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -363,7 +365,7 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot delete updb authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest().Delete("/authenticators/" + eid.New()) + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest().Delete("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -371,7 +373,7 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot create cert authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := certNonAdminUserSession.newAuthenticatedRequest(). + resp, err := certNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]interface{}{ "identityId": updbNonAdminUser.Id, @@ -379,7 +381,7 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { "password": eid.New(), "username": eid.New(), }). - Post("/authenticators") + Post("authenticators") req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -387,33 +389,33 @@ func Test_Authenticators_NonAdminUsingAdminEndpoints(t *testing.T) { t.Run("cannot update cert authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest(). + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]string{ "currentPassword": "assdfasdf", "password": "asdfasdf", "username": "asdfasdf", }). - Put("/authenticators/" + eid.New()) + Put("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) }) t.Run("cannot patch cert authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest(). + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "application/json"). SetBody(map[string]interface{}{ "certPem": "", }). - Patch("/authenticators/" + eid.New()) + Patch("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) }) t.Run("cannot delete cert authenticator for a different identity, receives unauthorized", func(t *testing.T) { req := require.New(t) - resp, err := updbNonAdminSession.newAuthenticatedRequest().Delete("/authenticators/" + eid.New()) + resp, err := updbNonAdminManagementSession.newAuthenticatedRequest().Delete("authenticators/" + eid.New()) req.NoError(err) standardErrorJsonResponseTests(resp, errorz.UnauthorizedCode, http.StatusUnauthorized, t) @@ -424,21 +426,16 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - _, updbNonAdminUserAuthenticator := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - updbNonAdminSession, err := updbNonAdminUserAuthenticator.Authenticate(ctx) + _, updbNonAdminUserAuthenticator := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + updbNonAdminSession, err := updbNonAdminUserAuthenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err, "expected no error during non-admin updb authentication") - if err != nil { - ctx.Req.NoError(err, "expected no error during non-admin updb authentication") - } + _, certNonAdminUserAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) + certNonAdminUserSession, err := certNonAdminUserAuthenticator.AuthenticateClientApi(ctx) + ctx.Req.NoError(err, "expected no error during non-admin cert authentication") - _, certNonAdminUserAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) - certNonAdminUserSession, err := certNonAdminUserAuthenticator.Authenticate(ctx) - - if err != nil { - ctx.Req.NoError(err, "expected no error during non-admin cert authentication") - } t.Run("can access their authenticators", func(t *testing.T) { req := require.New(t) @@ -526,7 +523,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("for update if the authenticator id is for another identity", func(t *testing.T) { //access updb's authenticator from cert identity - resp, err := certNonAdminUserSession.newAuthenticatedJsonRequest(`{"currentPassword": "123456", "password":"456789", "username":"username123456"}`). + resp, err := certNonAdminUserSession.newAuthenticatedRequestWithBody(`{"currentPassword": "123456", "password":"456789", "username":"username123456"}`). SetBody(map[string]string{ "currentPassword": "assdfasdf", "password": "asdfasdf", @@ -541,7 +538,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("for update if the authenticator id is made up", func(t *testing.T) { //access updb's authenticator from cert identity - resp, err := certNonAdminUserSession.newAuthenticatedJsonRequest(`{"currentPassword": "123456", "password":"456789", "username":"username123456"}`). + resp, err := certNonAdminUserSession.newAuthenticatedRequestWithBody(`{"currentPassword": "123456", "password":"456789", "username":"username123456"}`). Put("/current-identity/authenticators/" + eid.New()) req.NoError(err) @@ -551,7 +548,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("for patch if the authenticator id is for another identity", func(t *testing.T) { //access updb's authenticator from cert identity - resp, err := certNonAdminUserSession.newAuthenticatedJsonRequest(`{"currentPassword": "123456", "password":"456789"}`). + resp, err := certNonAdminUserSession.newAuthenticatedRequestWithBody(`{"currentPassword": "123456", "password":"456789"}`). Patch("/current-identity/authenticators/" + authenticatorId) req.NoError(err) @@ -561,7 +558,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("for patch if the authenticator id is made up", func(t *testing.T) { //access updb's authenticator from cert identity - resp, err := certNonAdminUserSession.newAuthenticatedJsonRequest(`{"currentPassword": "123456", "password":"456789"}`). + resp, err := certNonAdminUserSession.newAuthenticatedRequestWithBody(`{"currentPassword": "123456", "password":"456789"}`). Patch("/current-identity/authenticators/" + eid.New()) req.NoError(err) @@ -581,7 +578,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("can not create as it isn't supported", func(t *testing.T) { req := require.New(t) - resp, err := certNonAdminUserSession.newAuthenticatedJsonRequest("{}").Post("/current-identity/authenticators/") + resp, err := certNonAdminUserSession.newAuthenticatedRequestWithBody("{}").Post("/current-identity/authenticators/") req.NoError(err) @@ -592,8 +589,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -610,7 +607,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { newPassword := eid.New() body := fmt.Sprintf(`{"username":"%s", "password":"%s", "currentPassword":"%s"}`, newUsername, newPassword, auth.Password) - resp, err := authSession.newAuthenticatedJsonRequest(body). + resp, err := authSession.newAuthenticatedRequestWithBody(body). Put("/current-identity/authenticators/" + authId) req.NoError(err) @@ -623,7 +620,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { auth.Username = newUsername auth.Password = newPassword - _, err := auth.Authenticate(ctx) + _, err := auth.AuthenticateClientApi(ctx) req.NoError(err) }) @@ -633,8 +630,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -651,7 +648,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { newPassword := eid.New() body := fmt.Sprintf(`{"username":"%s", "password":"%s", "currentPassword":"%s"}`, newUsername, newPassword, eid.New()) - resp, err := authSession.newAuthenticatedJsonRequest(body). + resp, err := authSession.newAuthenticatedRequestWithBody(body). Put("/current-identity/authenticators/" + authId) req.NoError(err) @@ -661,8 +658,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("a non-admin can authenticate with the original updb credentials", func(t *testing.T) { ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - _, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + _, err := auth.AuthenticateClientApi(ctx) req.NoError(err) }) @@ -672,8 +669,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -689,7 +686,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { newPassword := eid.New() body := fmt.Sprintf(`{"password":"%s", "currentPassword":"%s"}`, newPassword, auth.Password) - resp, err := authSession.newAuthenticatedJsonRequest(body). + resp, err := authSession.newAuthenticatedRequestWithBody(body). Patch("/current-identity/authenticators/" + authId) req.NoError(err) @@ -701,7 +698,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { auth.Password = newPassword - _, err := auth.Authenticate(ctx) + _, err := auth.AuthenticateClientApi(ctx) req.NoError(err) }) @@ -711,8 +708,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -728,7 +725,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { newPassword := eid.New() body := fmt.Sprintf(`{"password":"%s", "currentPassword":"%s"}`, newPassword, eid.New()) - resp, err := authSession.newAuthenticatedJsonRequest(body). + resp, err := authSession.newAuthenticatedRequestWithBody(body). Patch("/current-identity/authenticators/" + authId) req.NoError(err) @@ -738,8 +735,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { t.Run("a non-admin can authenticate with original updb credentials", func(t *testing.T) { ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) - _, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), eid.New(), false) + _, err := auth.AuthenticateClientApi(ctx) req.NoError(err) }) @@ -749,8 +746,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -763,7 +760,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req.True(ok) req.NotEmpty(authId) - resp, err := authSession.newAuthenticatedJsonRequest(map[string]string{ + resp, err := authSession.newAuthenticatedRequestWithBody(map[string]string{ "currentPassword": "assdfasdf", "password": "asdfasdf", "username": "asdfasdf", @@ -778,8 +775,8 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req := require.New(t) ctx.testContextChanged(t) - _, auth := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) - authSession, err := auth.Authenticate(ctx) + _, auth := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) + authSession, err := auth.AuthenticateClientApi(ctx) req.NoError(err) authResp, err := authSession.newAuthenticatedRequest().Get("/current-identity/authenticators") @@ -792,7 +789,7 @@ func Test_Authenticators_NonAdminUsingSelfServiceEndpoints(t *testing.T) { req.True(ok) req.NotEmpty(authId) - resp, err := authSession.newAuthenticatedJsonRequest(map[string]string{ + resp, err := authSession.newAuthenticatedRequestWithBody(map[string]string{ "currentPassword": "assdfasdf", "password": "asdfasdf", "username": "asdfasdf", diff --git a/tests/ca_test.go b/tests/ca_test.go index 9d92f2dee..39fb84171 100644 --- a/tests/ca_test.go +++ b/tests/ca_test.go @@ -16,16 +16,16 @@ func Test_CA(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("identity attributes should be created", func(t *testing.T) { ctx.testContextChanged(t) role1 := eid.New() role2 := eid.New() ca := newTestCa(role1, role2) - ca.id = ctx.AdminSession.requireCreateEntity(ca) - ctx.AdminSession.validateEntityWithQuery(ca) - ctx.AdminSession.validateEntityWithLookup(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) + ctx.AdminManagementSession.validateEntityWithQuery(ca) + ctx.AdminManagementSession.validateEntityWithLookup(ca) }) t.Run("identity attributes should be updated", func(t *testing.T) { @@ -33,12 +33,12 @@ func Test_CA(t *testing.T) { role1 := eid.New() role2 := eid.New() ca := newTestCa(role1, role2) - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) role3 := eid.New() ca.identityRoles = []string{role2, role3} - ctx.AdminSession.requireUpdateEntity(ca) - ctx.AdminSession.validateEntityWithLookup(ca) + ctx.AdminManagementSession.requireUpdateEntity(ca) + ctx.AdminManagementSession.validateEntityWithLookup(ca) }) t.Run("identity name format should default if not specified", func(t *testing.T) { @@ -48,13 +48,13 @@ func Test_CA(t *testing.T) { ca := newTestCa(role1, role2) ca.identityNameFormat = "" - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) //set to default for verification ca.identityNameFormat = model.DefaultCaIdentityNameFormat - ctx.AdminSession.validateEntityWithQuery(ca) - ctx.AdminSession.validateEntityWithLookup(ca) + ctx.AdminManagementSession.validateEntityWithQuery(ca) + ctx.AdminManagementSession.validateEntityWithLookup(ca) }) t.Run("identities from auto enrollment inherit CA identity roles", func(t *testing.T) { @@ -62,9 +62,9 @@ func Test_CA(t *testing.T) { role1 := eid.New() role2 := eid.New() ca := newTestCa(role1, role2) - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) @@ -73,7 +73,7 @@ func Test_CA(t *testing.T) { clientAuthenticator := ca.CreateSignedCert(eid.New()) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -84,11 +84,11 @@ func Test_CA(t *testing.T) { ctx.completeCaAutoEnrollment(clientAuthenticator) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - identity := ctx.AdminSession.requireQuery("identities/" + enrolledSession.identityId) + identity := ctx.AdminManagementSession.requireQuery("identities/" + enrolledSession.identityId) sort.Strings(ca.identityRoles) ctx.pathEqualsStringSlice(identity, ca.identityRoles, path("data", "roleAttributes")) }) @@ -99,9 +99,9 @@ func Test_CA(t *testing.T) { expectedName := "singular.name.not.great" ca.identityNameFormat = expectedName - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) @@ -110,7 +110,7 @@ func Test_CA(t *testing.T) { clientAuthenticator := ca.CreateSignedCert(eid.New()) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -121,11 +121,11 @@ func Test_CA(t *testing.T) { ctx.completeCaAutoEnrollment(clientAuthenticator) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - identity := ctx.AdminSession.requireQuery("identities/" + enrolledSession.identityId) + identity := ctx.AdminManagementSession.requireQuery("identities/" + enrolledSession.identityId) ctx.Req.Equal(expectedName, identity.Path("data.name").Data().(string)) }) @@ -138,16 +138,16 @@ func Test_CA(t *testing.T) { //create CA ca := newTestCa() ca.identityNameFormat = firstExpectedName - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) //validate CA validationAuth := ca.CreateSignedCert(verificationToken) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -160,22 +160,22 @@ func Test_CA(t *testing.T) { firstClientAuthenticator := ca.CreateSignedCert(eid.New()) ctx.completeCaAutoEnrollment(firstClientAuthenticator) - firstEnrolledSession, err := firstClientAuthenticator.Authenticate(ctx) + firstEnrolledSession, err := firstClientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - firstIdentity := ctx.AdminSession.requireQuery("identities/" + firstEnrolledSession.identityId) + firstIdentity := ctx.AdminManagementSession.requireQuery("identities/" + firstEnrolledSession.identityId) ctx.Req.Equal(firstExpectedName, firstIdentity.Path("data.name").Data().(string)) //second firstIdentity that collides, becomes secondClientAuthenticator := ca.CreateSignedCert(eid.New()) ctx.completeCaAutoEnrollment(secondClientAuthenticator) - secondEnrolledSession, err := secondClientAuthenticator.Authenticate(ctx) + secondEnrolledSession, err := secondClientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - secondIdentity := ctx.AdminSession.requireQuery("identities/" + secondEnrolledSession.identityId) + secondIdentity := ctx.AdminManagementSession.requireQuery("identities/" + secondEnrolledSession.identityId) ctx.Req.Equal(secondExpectedName, secondIdentity.Path("data.name").Data().(string)) }) @@ -184,9 +184,9 @@ func Test_CA(t *testing.T) { ca := newTestCa() ca.identityNameFormat = "[caName] - [caId] - [commonName] - [requestedName] - [identityId]" - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) @@ -195,7 +195,7 @@ func Test_CA(t *testing.T) { clientAuthenticator := ca.CreateSignedCert(eid.New()) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -207,11 +207,11 @@ func Test_CA(t *testing.T) { requestedName := "bobby" ctx.completeCaAutoEnrollmentWithName(clientAuthenticator, requestedName) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - identity := ctx.AdminSession.requireQuery("identities/" + enrolledSession.identityId) + identity := ctx.AdminManagementSession.requireQuery("identities/" + enrolledSession.identityId) expectedName := fmt.Sprintf("%s - %s - %s - %s - %s", ca.name, ca.id, clientAuthenticator.cert.Subject.CommonName, requestedName, enrolledSession.identityId) ctx.Req.Equal(expectedName, identity.Path("data.name").Data().(string)) @@ -221,16 +221,16 @@ func Test_CA(t *testing.T) { ctx.testContextChanged(t) ca := newTestCa() - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) validationAuth := ca.CreateSignedCert(verificationToken) clientAuthenticator := ca.CreateSignedCert(eid.New()) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -241,7 +241,7 @@ func Test_CA(t *testing.T) { ctx.completeCaAutoEnrollment(clientAuthenticator) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(enrolledSession) @@ -249,11 +249,11 @@ func Test_CA(t *testing.T) { t.Run("CAs with auth disabled can no longer authenticate", func(t *testing.T) { ctx.testContextChanged(t) ca.isAuthEnabled = false - resp := ctx.AdminSession.patchEntity(ca, "isAuthEnabled") + resp := ctx.AdminManagementSession.patchEntity(ca, "isAuthEnabled") ctx.Req.NotEmpty(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.Error(err) ctx.Req.Empty(enrolledSession) @@ -262,11 +262,11 @@ func Test_CA(t *testing.T) { t.Run("CAs with auth re-enabled an authenticate", func(t *testing.T) { ctx.testContextChanged(t) ca.isAuthEnabled = true - resp := ctx.AdminSession.patchEntity(ca, "isAuthEnabled") + resp := ctx.AdminManagementSession.patchEntity(ca, "isAuthEnabled") ctx.Req.NotEmpty(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(enrolledSession) @@ -274,9 +274,9 @@ func Test_CA(t *testing.T) { t.Run("deleting a CA no longer allows authentication", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.requireDeleteEntity(ca) + ctx.AdminManagementSession.requireDeleteEntity(ca) - enrolledSession, err := clientAuthenticator.Authenticate(ctx) + enrolledSession, err := clientAuthenticator.AuthenticateClientApi(ctx) ctx.Req.Error(err) ctx.Req.Empty(enrolledSession) @@ -295,15 +295,15 @@ func Test_CA(t *testing.T) { ca := newTestCa() - ca.id = ctx.AdminSession.requireCreateEntity(ca) + ca.id = ctx.AdminManagementSession.requireCreateEntity(ca) - caValues := ctx.AdminSession.requireQuery("cas/" + ca.id) + caValues := ctx.AdminManagementSession.requireQuery("cas/" + ca.id) verificationToken := caValues.Path("data.verificationToken").Data().(string) ctx.Req.NotEmpty(verificationToken) validationAuth := ca.CreateSignedCert(verificationToken) - resp, err := ctx.AdminSession.newAuthenticatedRequest(). + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest(). SetHeader("content-type", "text/plain"). SetBody(validationAuth.certPem). Post("cas/" + ca.id + "/verify") @@ -312,21 +312,21 @@ func Test_CA(t *testing.T) { ctx.logJson(resp.Body()) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - unenrolledOttCaIdentity = ctx.AdminSession.RequireNewIdentityWithCaOtt(false, ca.id) + unenrolledOttCaIdentity = ctx.AdminManagementSession.RequireNewIdentityWithCaOtt(false, ca.id) - unenrolledOttCaIdentityContainer = ctx.AdminSession.requireQuery("/identities/" + unenrolledOttCaIdentity.Id) + unenrolledOttCaIdentityContainer = ctx.AdminManagementSession.requireQuery("/identities/" + unenrolledOttCaIdentity.Id) ctx.Req.True(unenrolledOttCaIdentityContainer.ExistsP("data.enrollment.ottca.id"), "expected ottca to have an enrollment id") enrollmentId = unenrolledOttCaIdentityContainer.Path("data.enrollment.ottca.id").Data().(string) ctx.Req.NotEmpty(enrollmentId, "enrollment id should not be empty string") - ctx.AdminSession.requireDeleteEntity(ca) + ctx.AdminManagementSession.requireDeleteEntity(ca) t.Run("enrollment should have been removed", func(t *testing.T) { ctx.testContextChanged(t) - status, _ := ctx.AdminSession.query("/enrollments/" + enrollmentId) + status, _ := ctx.AdminManagementSession.query("enrollments/" + enrollmentId) ctx.Req.Equal(http.StatusNotFound, status, "expected enrollment to not be found") @@ -336,14 +336,14 @@ func Test_CA(t *testing.T) { ctx.testContextChanged(t) ctx.Req.NotEmpty(unenrolledOttCaIdentity.Id) - _ = ctx.AdminSession.requireQuery(fmt.Sprintf(`/identities?filter=id="%s"`, unenrolledOttCaIdentity.Id)) + _ = ctx.AdminManagementSession.requireQuery(fmt.Sprintf(`identities?filter=id="%s"`, unenrolledOttCaIdentity.Id)) }) t.Run("identities with previous enrollments tied to deleted CAs should not error on detail", func(t *testing.T) { ctx.testContextChanged(t) ctx.Req.NotEmpty(unenrolledOttCaIdentity.Id) - _ = ctx.AdminSession.requireQuery("/identities/" + unenrolledOttCaIdentity.Id) + _ = ctx.AdminManagementSession.requireQuery("identities/" + unenrolledOttCaIdentity.Id) }) }) }) diff --git a/tests/config_test.go b/tests/config_test.go index 14881ce89..f5979f699 100644 --- a/tests/config_test.go +++ b/tests/config_test.go @@ -31,58 +31,60 @@ func Test_Configs(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() identityRole := eid.New() - nonAdminUser := ctx.AdminSession.createUserAndLogin(false, s(identityRole), nil) + nonAdminUserClientSession := ctx.AdminManagementSession.createUserAndLoginClientApi(false, s(identityRole), nil) + nonAdminUserManagementSession, err := nonAdminUserClientSession.CloneToManagementApi(ctx) + ctx.Req.NoError(err) t.Run("create without name should fail", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() config := ctx.newConfig(configType.Id, map[string]interface{}{"port": 22}) config.Name = "" - resp := ctx.AdminSession.createEntity(config) + resp := ctx.AdminManagementSession.createEntity(config) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "name") }) t.Run("create without data should fail", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() config := ctx.newConfig(configType.Id, nil) - resp := ctx.AdminSession.createEntity(config) + resp := ctx.AdminManagementSession.createEntity(config) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "data") }) t.Run("create without type should fail", func(t *testing.T) { ctx.testContextChanged(t) config := ctx.newConfig("", map[string]interface{}{"port": 22}) - resp := ctx.AdminSession.createEntity(config) + resp := ctx.AdminManagementSession.createEntity(config) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "type") }) t.Run("create with invalid config type should fail", func(t *testing.T) { ctx.testContextChanged(t) config := ctx.newConfig(eid.New(), map[string]interface{}{"port": 22}) - resp := ctx.AdminSession.createEntity(config) + resp := ctx.AdminManagementSession.createEntity(config) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "type") }) t.Run("create should pass", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() now := time.Now() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) ctx.validateDateFieldsForCreate(now, entityJson) - entityJson = ctx.AdminSession.validateEntityWithLookup(config) + entityJson = ctx.AdminManagementSession.validateEntityWithLookup(config) ctx.validateDateFieldsForCreate(now, entityJson) }) t.Run("create with nested values should pass", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() now := time.Now() config := ctx.newConfig(configType.Id, map[string]interface{}{ "port": float64(22), @@ -100,49 +102,50 @@ func Test_Configs(t *testing.T) { }, }) config.Tags = map[string]interface{}{"org": "na", "deprecated": false} - config.Id = ctx.AdminSession.requireCreateEntity(config) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config.Id = ctx.AdminManagementSession.requireCreateEntity(config) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) ctx.validateDateFieldsForCreate(now, entityJson) - entityJson = ctx.AdminSession.validateEntityWithLookup(config) + entityJson = ctx.AdminManagementSession.validateEntityWithLookup(config) ctx.validateDateFieldsForCreate(now, entityJson) }) t.Run("lookup non-existent config as admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - ctx.RequireNotFoundError(ctx.AdminSession.query("configs/" + eid.New())) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("configs/" + eid.New())) }) t.Run("lookup config as non-admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": 22}) - ctx.requireUnauthorizedError(nonAdminUser.query("configs/" + config.Id)) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": 22}) + + ctx.requireUnauthorizedError(nonAdminUserManagementSession.query("configs/" + config.Id)) }) t.Run("update config should pass", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() now := time.Now() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) createdAt := ctx.validateDateFieldsForCreate(now, entityJson) time.Sleep(time.Millisecond * 10) now = time.Now() config.Data = map[string]interface{}{"snafu": false} - ctx.AdminSession.requireUpdateEntity(config) - jsonConfig := ctx.AdminSession.validateUpdate(config) + ctx.AdminManagementSession.requireUpdateEntity(config) + jsonConfig := ctx.AdminManagementSession.validateUpdate(config) ctx.validateDateFieldsForUpdate(now, createdAt, jsonConfig) }) t.Run("patch config should pass", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() now := time.Now() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) createdAt := ctx.validateDateFieldsForCreate(now, entityJson) time.Sleep(time.Millisecond * 10) @@ -151,11 +154,11 @@ func Test_Configs(t *testing.T) { config.Name = newName config.Data = map[string]interface{}{"foo": "bar"} config.Tags = map[string]interface{}{"baz": "bam"} - ctx.AdminSession.requirePatchEntity(config, "name") + ctx.AdminManagementSession.requirePatchEntity(config, "name") config.Data = map[string]interface{}{"port": float64(22)} // data should not have gotten updated config.Tags = nil // tags should not be updated - jsonConfig := ctx.AdminSession.validateUpdate(config) + jsonConfig := ctx.AdminManagementSession.validateUpdate(config) ctx.validateDateFieldsForUpdate(now, createdAt, jsonConfig) time.Sleep(time.Millisecond * 10) @@ -163,69 +166,69 @@ func Test_Configs(t *testing.T) { config.Name = eid.New() config.Data = map[string]interface{}{"foo": "bar"} config.Tags = map[string]interface{}{"baz": "bam"} - ctx.AdminSession.requirePatchEntity(config, "data") + ctx.AdminManagementSession.requirePatchEntity(config, "data") config.Name = newName // name should not be updated config.Tags = nil // tags should not be updated - ctx.AdminSession.validateUpdate(config) + ctx.AdminManagementSession.validateUpdate(config) time.Sleep(time.Millisecond * 10) now = time.Now() config.Name = eid.New() config.Data = map[string]interface{}{"bim": "bam"} config.Tags = map[string]interface{}{"enlightened": false} - ctx.AdminSession.requirePatchEntity(config, "tags") + ctx.AdminManagementSession.requirePatchEntity(config, "tags") config.Name = newName // name should not be updated config.Data = map[string]interface{}{"foo": "bar"} // data should not have gotten updated - ctx.AdminSession.validateUpdate(config) + ctx.AdminManagementSession.validateUpdate(config) time.Sleep(time.Millisecond * 10) now = time.Now() config.Name = eid.New() config.Data = map[string]interface{}{"bim": "bom"} config.Tags = map[string]interface{}{"enlightened": true} - ctx.AdminSession.requirePatchEntity(config, "name", "data", "tags") - ctx.AdminSession.validateUpdate(config) + ctx.AdminManagementSession.requirePatchEntity(config, "name", "data", "tags") + ctx.AdminManagementSession.validateUpdate(config) }) t.Run("update of type config should fail", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) - ctx.AdminSession.validateEntityWithQuery(config) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) + ctx.AdminManagementSession.validateEntityWithQuery(config) - configType2 := ctx.AdminSession.requireCreateNewConfigType() + configType2 := ctx.AdminManagementSession.requireCreateNewConfigType() config.sendType = false config.ConfigTypeId = configType2.Id - ctx.AdminSession.requireUpdateEntity(config) + ctx.AdminManagementSession.requireUpdateEntity(config) config.ConfigTypeId = configType.Id - ctx.AdminSession.validateEntityWithQuery(config) + ctx.AdminManagementSession.validateEntityWithQuery(config) config.ConfigTypeId = configType2.Id - ctx.AdminSession.requirePatchEntity(config, "name", "type") + ctx.AdminManagementSession.requirePatchEntity(config, "name", "type") config.ConfigTypeId = configType.Id - ctx.AdminSession.validateEntityWithQuery(config) + ctx.AdminManagementSession.validateEntityWithQuery(config) }) t.Run("delete should pass", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() now := time.Now() - config := ctx.AdminSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config := ctx.AdminManagementSession.requireCreateNewConfig(configType.Id, map[string]interface{}{"port": float64(22)}) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) ctx.validateDateFieldsForCreate(now, entityJson) - ctx.AdminSession.requireDeleteEntity(config) - ctx.RequireNotFoundError(ctx.AdminSession.query("configs/" + config.Id)) + ctx.AdminManagementSession.requireDeleteEntity(config) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("configs/" + config.Id)) }) t.Run("create config type with non-object schema should fail", func(t *testing.T) { ctx.testContextChanged(t) ctx.testContextChanged(t) - resp := ctx.AdminSession.createEntityOfType("config-types", map[string]interface{}{ + resp := ctx.AdminManagementSession.createEntityOfType("config-types", map[string]interface{}{ "name": eid.New(), "schema": "not-object", }) @@ -254,10 +257,10 @@ func Test_Configs(t *testing.T) { }, }, } - configType.Id = ctx.AdminSession.requireCreateEntity(configType) + configType.Id = ctx.AdminManagementSession.requireCreateEntity(configType) config := ctx.newConfig(configType.Id, map[string]interface{}{"port": 22}) - resp := ctx.AdminSession.createEntity(config) + resp := ctx.AdminManagementSession.createEntity(config) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "(root)") now := time.Now() @@ -265,8 +268,8 @@ func Test_Configs(t *testing.T) { "hostname": "ssh.globotech.bizniz", "port": float64(22), }) - config.Id = ctx.AdminSession.requireCreateEntity(config) - entityJson := ctx.AdminSession.validateEntityWithQuery(config) + config.Id = ctx.AdminManagementSession.requireCreateEntity(config) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(config) ctx.validateDateFieldsForCreate(now, entityJson) }) } diff --git a/tests/config_type_test.go b/tests/config_type_test.go index 0f0c8b829..4c5d715b8 100644 --- a/tests/config_type_test.go +++ b/tests/config_type_test.go @@ -30,28 +30,30 @@ func Test_ConfigTypes(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() identityRole := eid.New() - nonAdminUser := ctx.AdminSession.createUserAndLogin(false, s(identityRole), nil) + nonAdminUserClientSession := ctx.AdminManagementSession.createUserAndLoginClientApi(false, s(identityRole), nil) + nonAdminUserManagementSession, err := nonAdminUserClientSession.CloneToManagementApi(ctx) + ctx.Req.NoError(err) t.Run("create config type without name should fail", func(t *testing.T) { ctx.testContextChanged(t) configType := ctx.newConfigType() configType.Name = "" - resp := ctx.AdminSession.createEntity(configType) + resp := ctx.AdminManagementSession.createEntity(configType) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "name") }) t.Run("create config type without schema should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() - entityJson := ctx.AdminSession.validateEntityWithQuery(configType) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(configType) ctx.validateDateFieldsForCreate(now, entityJson) - entityJson = ctx.AdminSession.validateEntityWithLookup(configType) + entityJson = ctx.AdminManagementSession.validateEntityWithLookup(configType) ctx.validateDateFieldsForCreate(now, entityJson) }) @@ -72,7 +74,7 @@ func Test_ConfigTypes(t *testing.T) { }, }, } - resp := ctx.AdminSession.createEntity(configType) + resp := ctx.AdminManagementSession.createEntity(configType) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "schema") }) @@ -100,32 +102,32 @@ func Test_ConfigTypes(t *testing.T) { }, }, } - configType.Id = ctx.AdminSession.requireCreateEntity(configType) + configType.Id = ctx.AdminManagementSession.requireCreateEntity(configType) - entityJson := ctx.AdminSession.validateEntityWithQuery(configType) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(configType) ctx.validateDateFieldsForCreate(now, entityJson) - entityJson = ctx.AdminSession.validateEntityWithLookup(configType) + entityJson = ctx.AdminManagementSession.validateEntityWithLookup(configType) ctx.validateDateFieldsForCreate(now, entityJson) }) t.Run("lookup non-existent config type as admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - ctx.RequireNotFoundError(ctx.AdminSession.query("config-types/" + eid.New())) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("config-types/" + eid.New())) }) t.Run("lookup config type as non-admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - configType := ctx.AdminSession.requireCreateNewConfigType() - ctx.requireUnauthorizedError(nonAdminUser.query("config-types/" + configType.Id)) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + ctx.requireUnauthorizedError(nonAdminUserManagementSession.query("config-types/" + configType.Id)) }) t.Run("update config type should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() - entityJson := ctx.AdminSession.validateEntityWithQuery(configType) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(configType) createdAt := ctx.validateDateFieldsForCreate(now, entityJson) time.Sleep(time.Millisecond * 10) @@ -149,17 +151,17 @@ func Test_ConfigTypes(t *testing.T) { }, }, } - ctx.AdminSession.requireUpdateEntity(configType) - jsonConfig := ctx.AdminSession.validateUpdate(configType) + ctx.AdminManagementSession.requireUpdateEntity(configType) + jsonConfig := ctx.AdminManagementSession.validateUpdate(configType) ctx.validateDateFieldsForUpdate(now, createdAt, jsonConfig) }) t.Run("patch config should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() - entityJson := ctx.AdminSession.validateEntityWithQuery(configType) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(configType) createdAt := ctx.validateDateFieldsForCreate(now, entityJson) time.Sleep(time.Millisecond * 10) @@ -183,20 +185,20 @@ func Test_ConfigTypes(t *testing.T) { }, }, } - ctx.AdminSession.requirePatchEntity(configType, "schema") - jsonConfig := ctx.AdminSession.validateUpdate(configType) + ctx.AdminManagementSession.requirePatchEntity(configType, "schema") + jsonConfig := ctx.AdminManagementSession.validateUpdate(configType) ctx.validateDateFieldsForUpdate(now, createdAt, jsonConfig) }) t.Run("delete should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - configType := ctx.AdminSession.requireCreateNewConfigType() + configType := ctx.AdminManagementSession.requireCreateNewConfigType() - entityJson := ctx.AdminSession.validateEntityWithQuery(configType) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(configType) ctx.validateDateFieldsForCreate(now, entityJson) - ctx.AdminSession.requireDeleteEntity(configType) - ctx.RequireNotFoundError(ctx.AdminSession.query("config-types/" + configType.Id)) + ctx.AdminManagementSession.requireDeleteEntity(configType) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("config-types/" + configType.Id)) }) } diff --git a/tests/context.go b/tests/context.go index 5c110b315..2dcfea807 100644 --- a/tests/context.go +++ b/tests/context.go @@ -39,15 +39,16 @@ import ( "github.com/openziti/fabric/router/xgress" "github.com/openziti/foundation/common" "github.com/openziti/foundation/identity/certtools" - nfpem "github.com/openziti/foundation/util/pem" - sdkconfig "github.com/openziti/sdk-golang/ziti/config" + nfPem "github.com/openziti/foundation/util/pem" + sdkConfig "github.com/openziti/sdk-golang/ziti/config" "github.com/openziti/sdk-golang/ziti/edge" - sdkenroll "github.com/openziti/sdk-golang/ziti/enroll" + sdkEnroll "github.com/openziti/sdk-golang/ziti/enroll" "github.com/pkg/errors" "io" "net" "net/http" "net/http/cookiejar" + "net/url" "os" "path/filepath" "runtime" @@ -91,14 +92,16 @@ func init() { } type TestContext struct { - ApiHost string - AdminAuthenticator *updbAuthenticator - AdminSession *session - fabricController *controller.Controller - EdgeController *server.Controller - Req *require.Assertions - client *resty.Client - enabledJsonLogging bool + ApiHost string + AdminAuthenticator *updbAuthenticator + AdminManagementSession *session + AdminClientSession *session + fabricController *controller.Controller + EdgeController *server.Controller + Req *require.Assertions + clientApiClient *resty.Client + managementApiClient *resty.Client + enabledJsonLogging bool edgeRouterEntity *edgeRouter transitRouterEntity *transitRouter @@ -134,6 +137,9 @@ func GetTestContext() *TestContext { return defaultTestContext } +// testContextChanged is used to update the *testing.T reference used by library +// level tests. Necessary because using the wrong *testing.T will cause go test library +// errors. func (ctx *TestContext) testContextChanged(t *testing.T) { ctx.testing = t ctx.Req = require.New(t) @@ -143,11 +149,11 @@ func (ctx *TestContext) T() *testing.T { return ctx.testing } -func (ctx *TestContext) Transport() *http.Transport { - return ctx.TransportWithClientCert(nil, nil) +func (ctx *TestContext) NewTransport() *http.Transport { + return ctx.NewTransportWithClientCert(nil, nil) } -func (ctx *TestContext) TransportWithClientCert(cert *x509.Certificate, privateKey crypto.PrivateKey) *http.Transport { +func (ctx *TestContext) NewTransportWithClientCert(cert *x509.Certificate, privateKey crypto.PrivateKey) *http.Transport { tlsClientConfig := &cryptoTls.Config{ InsecureSkipVerify: true, } @@ -173,7 +179,7 @@ func (ctx *TestContext) TransportWithClientCert(cert *x509.Certificate, privateK } } -func (ctx *TestContext) HttpClient(transport *http.Transport) *http.Client { +func (ctx *TestContext) NewHttpClient(transport *http.Transport) *http.Client { jar, err := cookiejar.New(&cookiejar.Options{}) ctx.Req.NoError(err) @@ -185,37 +191,54 @@ func (ctx *TestContext) HttpClient(transport *http.Transport) *http.Client { } } -func (ctx *TestContext) Client(httpClient *http.Client) *resty.Client { - client := resty.NewWithClient(httpClient) - return client +func (ctx *TestContext) NewRestClientWithDefaults() *resty.Client { + return resty.NewWithClient(ctx.NewHttpClient(ctx.NewTransport())) } -func (ctx *TestContext) NewClient() *resty.Client { - return ctx.Client(ctx.HttpClient(ctx.Transport())) -} - -func (ctx *TestContext) DefaultClient() *resty.Client { - if ctx.client == nil { - ctx.client, _, _ = ctx.NewClientComponents() - ctx.client.AllowGetMethodPayload = true +func (ctx *TestContext) DefaultClientApiClient() *resty.Client { + if ctx.clientApiClient == nil { + ctx.clientApiClient, _, _ = ctx.NewClientComponents(EdgeClientApiPath) + ctx.clientApiClient.AllowGetMethodPayload = true } - return ctx.client + return ctx.clientApiClient } -func (ctx *TestContext) NewClientComponents() (*resty.Client, *http.Client, *http.Transport) { - clientTransport := ctx.Transport() - httpClient := ctx.HttpClient(clientTransport) - client := ctx.Client(httpClient) +func (ctx *TestContext) DefaultManagementApiClient() *resty.Client { + if ctx.managementApiClient == nil { + ctx.managementApiClient, _, _ = ctx.NewClientComponents(EdgeManagementApiPath) + ctx.managementApiClient.AllowGetMethodPayload = true + } + return ctx.clientApiClient +} - client.SetHostURL("https://" + ctx.ApiHost) +func (ctx *TestContext) NewClientComponents(apiPath string) (*resty.Client, *http.Client, *http.Transport) { + clientTransport := ctx.NewTransport() + httpClient := ctx.NewHttpClient(clientTransport) + client := resty.NewWithClient(httpClient) + + apiUrl, err := url.Parse("https://" + ctx.ApiHost) + + if err != nil { + panic(err) + } + + apiPathUrl, err := url.Parse(apiPath) + + if err != nil { + panic(err) + } + + baseUrl := apiUrl.ResolveReference(apiPathUrl) + + client.SetHostURL(baseUrl.String()) return client, httpClient, clientTransport } func (ctx *TestContext) NewClientComponentsWithClientCert(cert *x509.Certificate, privateKey crypto.PrivateKey) (*resty.Client, *http.Client, *http.Transport) { - clientTransport := ctx.TransportWithClientCert(cert, privateKey) - httpClient := ctx.HttpClient(clientTransport) - client := ctx.Client(httpClient) + clientTransport := ctx.NewTransportWithClientCert(cert, privateKey) + httpClient := ctx.NewHttpClient(clientTransport) + client := resty.NewWithClient(httpClient) client.SetHostURL("https://" + ctx.ApiHost) @@ -291,30 +314,30 @@ func (ctx *TestContext) StartServerFor(test string, clean bool) { func (ctx *TestContext) createAndEnrollEdgeRouter(tunneler bool, roleAttributes ...string) *edgeRouter { // If an edge router has already been created, delete it and create a new one if ctx.edgeRouterEntity != nil { - ctx.AdminSession.requireDeleteEntity(ctx.edgeRouterEntity) + ctx.AdminManagementSession.requireDeleteEntity(ctx.edgeRouterEntity) ctx.edgeRouterEntity = nil } _ = os.MkdirAll("testdata/edge-router", os.FileMode(0755)) if tunneler { - ctx.edgeRouterEntity = ctx.AdminSession.requireNewTunnelerEnabledEdgeRouter(roleAttributes...) + ctx.edgeRouterEntity = ctx.AdminManagementSession.requireNewTunnelerEnabledEdgeRouter(roleAttributes...) } else { - ctx.edgeRouterEntity = ctx.AdminSession.requireNewEdgeRouter(roleAttributes...) + ctx.edgeRouterEntity = ctx.AdminManagementSession.requireNewEdgeRouter(roleAttributes...) } - jwt := ctx.AdminSession.getEdgeRouterJwt(ctx.edgeRouterEntity.id) + jwt := ctx.AdminManagementSession.getEdgeRouterJwt(ctx.edgeRouterEntity.id) configFile := EdgeRouterConfFile if tunneler { configFile = TunnelerEdgeRouterConfFile } - cfgmap, err := router.LoadConfigMap(configFile) + configMap, err := router.LoadConfigMap(configFile) ctx.Req.NoError(err) enroller := enroll.NewRestEnroller() - ctx.Req.NoError(enroller.LoadConfig(cfgmap)) - var keyAlg sdkconfig.KeyAlgVar - keyAlg.Set("RSA") + ctx.Req.NoError(enroller.LoadConfig(configMap)) + var keyAlg sdkConfig.KeyAlgVar + _ = keyAlg.Set("RSA") ctx.Req.NoError(enroller.Enroll([]byte(jwt), true, "", keyAlg)) return ctx.edgeRouterEntity @@ -323,22 +346,22 @@ func (ctx *TestContext) createAndEnrollEdgeRouter(tunneler bool, roleAttributes func (ctx *TestContext) createAndEnrollTransitRouter() *transitRouter { // If a tx router has already been created, delete it and create a new one if ctx.transitRouterEntity != nil { - ctx.AdminSession.requireDeleteEntity(ctx.transitRouterEntity) + ctx.AdminManagementSession.requireDeleteEntity(ctx.transitRouterEntity) ctx.transitRouterEntity = nil } _ = os.MkdirAll("testdata/transit-router", os.FileMode(0755)) - ctx.transitRouterEntity = ctx.AdminSession.requireNewTransitRouter() - jwt := ctx.AdminSession.getTransitRouterJwt(ctx.transitRouterEntity.id) + ctx.transitRouterEntity = ctx.AdminManagementSession.requireNewTransitRouter() + jwt := ctx.AdminManagementSession.getTransitRouterJwt(ctx.transitRouterEntity.id) - cfgmap, err := router.LoadConfigMap(TransitRouterConfFile) + configMap, err := router.LoadConfigMap(TransitRouterConfFile) ctx.Req.NoError(err) enroller := enroll.NewRestEnroller() - ctx.Req.NoError(enroller.LoadConfig(cfgmap)) - var keyAlg sdkconfig.KeyAlgVar - keyAlg.Set("RSA") + ctx.Req.NoError(enroller.LoadConfig(configMap)) + var keyAlg sdkConfig.KeyAlgVar + _ = keyAlg.Set("RSA") ctx.Req.NoError(enroller.Enroll([]byte(jwt), true, "", keyAlg)) return ctx.transitRouterEntity @@ -397,16 +420,16 @@ func (ctx *TestContext) startEdgeRouter() { ctx.Req.NoError(ctx.router.Start()) } -func (ctx *TestContext) EnrollIdentity(identityId string) *sdkconfig.Config { - jwt := ctx.AdminSession.getIdentityJwt(identityId) - tkn, _, err := sdkenroll.ParseToken(jwt) +func (ctx *TestContext) EnrollIdentity(identityId string) *sdkConfig.Config { + jwt := ctx.AdminManagementSession.getIdentityJwt(identityId) + tkn, _, err := sdkEnroll.ParseToken(jwt) ctx.Req.NoError(err) - flags := sdkenroll.EnrollmentFlags{ + flags := sdkEnroll.EnrollmentFlags{ Token: tkn, KeyAlg: "RSA", } - conf, err := sdkenroll.Enroll(flags) + conf, err := sdkEnroll.Enroll(flags) ctx.Req.NoError(err) return conf } @@ -434,39 +457,16 @@ func (ctx *TestContext) waitForPort(address string, duration time.Duration) erro } } -func (ctx *TestContext) unauthenticatedSession() *session { - return &session{ - testContext: ctx, - token: "", - authenticator: nil, - identityId: "", - } -} - -func (ctx *TestContext) loginWithCert(cert *x509.Certificate, key *crypto.PrivateKey) (*session, error) { - return (&certAuthenticator{ - cert: cert, - key: key, - }).Authenticate(ctx) -} - -func (ctx *TestContext) RequireAdminLogin() { +func (ctx *TestContext) RequireAdminManagementApiLogin() { var err error - ctx.AdminSession, err = ctx.AdminAuthenticator.Authenticate(ctx) + ctx.AdminManagementSession, err = ctx.AdminAuthenticator.AuthenticateManagementApi(ctx) ctx.Req.NoError(err) } -func (ctx *TestContext) requireLogin(username, password string) *session { - session, err := ctx.login(username, password) +func (ctx *TestContext) RequireAdminClientApiLogin() { + var err error + ctx.AdminClientSession, err = ctx.AdminAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - return session -} - -func (ctx *TestContext) login(username, password string) (*session, error) { - return (&updbAuthenticator{ - Username: username, - Password: password, - }).Authenticate(ctx) } func (ctx *TestContext) Teardown() { @@ -482,8 +482,13 @@ func (ctx *TestContext) Teardown() { } } -func (ctx *TestContext) newRequest() *resty.Request { - return ctx.DefaultClient().R(). +func (ctx *TestContext) newAnonymousClientApiRequest() *resty.Request { + return ctx.DefaultClientApiClient().R(). + SetHeader("content-type", "application/json") +} + +func (ctx *TestContext) newAnonymousManagementApiRequest() *resty.Request { + return ctx.DefaultClientApiClient().R(). SetHeader("content-type", "application/json") } @@ -495,7 +500,7 @@ func (ctx *TestContext) newRequestWithClientCert(cert *x509.Certificate, private } func (ctx *TestContext) completeUpdbEnrollment(identityId string, password string) { - result := ctx.AdminSession.requireQuery(fmt.Sprintf("identities/%v", identityId)) + result := ctx.AdminManagementSession.requireQuery(fmt.Sprintf("identities/%v", identityId)) path := result.Search(path("data.enrollment.updb.token")...) ctx.Req.NotNil(path) str, ok := path.Data().(string) @@ -504,7 +509,7 @@ func (ctx *TestContext) completeUpdbEnrollment(identityId string, password strin enrollBody := gabs.New() ctx.setJsonValue(enrollBody, password, "password") - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetBody(enrollBody.String()). Post("enroll?token=" + str) ctx.Req.NoError(err) @@ -513,14 +518,14 @@ func (ctx *TestContext) completeUpdbEnrollment(identityId string, password strin } func (ctx *TestContext) completeCaAutoEnrollment(certAuth *certAuthenticator) { - trans := ctx.Transport() + trans := ctx.NewTransport() trans.TLSClientConfig.Certificates = []cryptoTls.Certificate{ { Certificate: [][]byte{certAuth.cert.Raw}, PrivateKey: certAuth.key, }, } - client := ctx.Client(ctx.HttpClient(trans)) + client := resty.NewWithClient(ctx.NewHttpClient(trans)) client.SetHostURL("https://" + ctx.ApiHost) resp, err := client.NewRequest(). @@ -533,14 +538,14 @@ func (ctx *TestContext) completeCaAutoEnrollment(certAuth *certAuthenticator) { } func (ctx *TestContext) completeCaAutoEnrollmentWithName(certAuth *certAuthenticator, name string) { - trans := ctx.Transport() + trans := ctx.NewTransport() trans.TLSClientConfig.Certificates = []cryptoTls.Certificate{ { Certificate: [][]byte{certAuth.cert.Raw}, PrivateKey: certAuth.key, }, } - client := ctx.Client(ctx.HttpClient(trans)) + client := resty.NewWithClient(ctx.NewHttpClient(trans)) client.SetHostURL("https://" + ctx.ApiHost) body := gabs.New() @@ -556,7 +561,7 @@ func (ctx *TestContext) completeCaAutoEnrollmentWithName(certAuth *certAuthentic } func (ctx *TestContext) completeOttEnrollment(identityId string) *certAuthenticator { - result := ctx.AdminSession.requireQuery(fmt.Sprintf("identities/%v", identityId)) + result := ctx.AdminManagementSession.requireQuery(fmt.Sprintf("identities/%v", identityId)) tokenValue := result.Path("data.enrollment.ott.token") @@ -576,7 +581,7 @@ func (ctx *TestContext) completeOttEnrollment(identityId string) *certAuthentica csrPem := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE REQUEST", Bytes: csr}) - resp, err := ctx.newRequest(). + resp, err := ctx.newAnonymousClientApiRequest(). SetBody(csrPem). SetHeader("content-type", "application/x-pem-file"). SetHeader("accept", "application/json"). @@ -590,7 +595,7 @@ func (ctx *TestContext) completeOttEnrollment(identityId string) *certAuthentica err = json.Unmarshal(resp.Body(), envelope) ctx.Req.NoError(err) - certs := nfpem.PemToX509(envelope.Data.Cert) + certs := nfPem.PemToX509(envelope.Data.Cert) ctx.Req.NotEmpty(certs) @@ -626,7 +631,7 @@ func (ctx *TestContext) newPostureCheckMFA(roleAttributes []string) *postureChec func (ctx *TestContext) newPostureCheckProcessMulti(semantic rest_model.Semantic, processes []*rest_model.ProcessMulti, roleAttributes []string) *rest_model.PostureCheckProcessMultiCreate { check := &rest_model.PostureCheckProcessMultiCreate{ Processes: processes, - Semantic: semantic, + Semantic: &semantic, } check.SetRoleAttributes(roleAttributes) diff --git a/tests/current_identity_test.go b/tests/current_identity_test.go index 7869253b6..e6db4e339 100644 --- a/tests/current_identity_test.go +++ b/tests/current_identity_test.go @@ -23,18 +23,18 @@ func Test_CurrentIdentity(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("edge routers endpoint", func(t *testing.T) { ctx.testContextChanged(t) er1 := ctx.createAndEnrollEdgeRouter(false, "test1") - _ = ctx.AdminSession.requireNewEdgeRouter("test1") + _ = ctx.AdminManagementSession.requireNewEdgeRouter("test1") - _, identityAuth := ctx.AdminSession.requireCreateIdentityOttEnrollment("testErAccess", false, "test1") + _, identityAuth := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment("testErAccess", false, "test1") - identitySession, err := identityAuth.Authenticate(ctx) + identitySession, err := identityAuth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) t.Run("returns empty list with no edge router policies", func(t *testing.T) { @@ -51,7 +51,7 @@ func Test_CurrentIdentity(t *testing.T) { t.Run("returns a list of one with an er policy", func(t *testing.T) { ctx.testContextChanged(t) - _ = ctx.AdminSession.requireNewEdgeRouterPolicy([]string{"#test1"}, []string{"#test1"}) + _ = ctx.AdminManagementSession.requireNewEdgeRouterPolicy([]string{"#test1"}, []string{"#test1"}) erContainer := identitySession.requireQuery("/current-identity/edge-routers") @@ -67,7 +67,7 @@ func Test_CurrentIdentity(t *testing.T) { t.Run("returns empty list with if edge router is deleted", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.requireDeleteEntity(er1) + ctx.AdminManagementSession.requireDeleteEntity(er1) erContainer := identitySession.requireQuery("/current-identity/edge-routers") diff --git a/tests/data_flow_close_test.go b/tests/data_flow_close_test.go index 839cea5a0..461de3aa5 100644 --- a/tests/data_flow_close_test.go +++ b/tests/data_flow_close_test.go @@ -32,13 +32,13 @@ func Test_ServerConnClosePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) @@ -66,7 +66,7 @@ func Test_ServerConnClosePropagation(t *testing.T) { conn.RequireClose() }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -94,13 +94,13 @@ func Test_ServerContextClosePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) @@ -131,7 +131,7 @@ func Test_ServerContextClosePropagation(t *testing.T) { context.Close() }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -160,13 +160,13 @@ func Test_ServerCloseListenerPropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) @@ -199,7 +199,7 @@ func Test_ServerCloseListenerPropagation(t *testing.T) { conn.WriteString("hello, "+name, time.Second) }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -218,20 +218,20 @@ func Test_ClientConnClosePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) ctx.Req.NoError(err) defer listener.Close() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -280,20 +280,20 @@ func Test_ClientContextClosePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) ctx.Req.NoError(err) defer listener.Close() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -343,20 +343,20 @@ func Test_ServerConnCloseWritePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) ctx.Req.NoError(err) defer listener.Close() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -411,13 +411,13 @@ func Test_ClientConnCloseWritePropagation(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) @@ -450,7 +450,7 @@ func Test_ClientConnCloseWritePropagation(t *testing.T) { conn.RequireClose() }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) diff --git a/tests/data_flow_hs_rotating_test.go b/tests/data_flow_hs_rotating_test.go index ba3ad355b..6a30644d2 100644 --- a/tests/data_flow_hs_rotating_test.go +++ b/tests/data_flow_hs_rotating_test.go @@ -62,17 +62,17 @@ func testClientFirstWithStrategy(t *testing.T, strategy string) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(strategy) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(strategy) serverContextC := make(chan ziti.Context, 3) doneC := make(chan struct{}, 1) var serverContexts []ziti.Context for i := 0; i < 3; i++ { - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() serverContexts = append(serverContexts, context) @@ -120,7 +120,7 @@ func testClientFirstWithStrategy(t *testing.T, strategy string) { } }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) @@ -206,11 +206,11 @@ func testServerFirstWithStrategy(t *testing.T, strategy string) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(strategy) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(strategy) serverContextC := make(chan ziti.Context, 3) doneC := make(chan struct{}, 1) @@ -221,7 +221,7 @@ func testServerFirstWithStrategy(t *testing.T, strategy string) { dials := make(chan struct{}, 1000) for i := 0; i < 3; i++ { - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() serverContexts = append(serverContexts, context) @@ -263,7 +263,7 @@ func testServerFirstWithStrategy(t *testing.T, strategy string) { } }() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) diff --git a/tests/data_flow_hs_test.go b/tests/data_flow_hs_test.go index 8d58951f6..1fadb12c5 100644 --- a/tests/data_flow_hs_test.go +++ b/tests/data_flow_hs_test.go @@ -31,20 +31,20 @@ func Test_HSDataflow(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("weighted") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("weighted") ctx.CreateEnrollAndStartEdgeRouter() - _, hostContext1 := ctx.AdminSession.RequireCreateSdkContext() + _, hostContext1 := ctx.AdminManagementSession.RequireCreateSdkContext() defer hostContext1.Close() listener1, err := hostContext1.Listen(service.Name) ctx.Req.NoError(err) ctx.requireNListener(1, listener1, 2*time.Second) - _, hostContext2 := ctx.AdminSession.RequireCreateSdkContext() + _, hostContext2 := ctx.AdminManagementSession.RequireCreateSdkContext() defer hostContext2.Close() listener2, err := hostContext2.Listen(service.Name) @@ -73,7 +73,7 @@ func Test_HSDataflow(t *testing.T) { server1.start() server2.start() - clientIdentity := ctx.AdminSession.RequireNewIdentityWithOtt(false) + clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) clientContext := ziti.NewContextWithConfig(clientConfig) diff --git a/tests/data_flow_test.go b/tests/data_flow_test.go index 619979244..2916e0da1 100644 --- a/tests/data_flow_test.go +++ b/tests/data_flow_test.go @@ -29,12 +29,12 @@ func Test_Dataflow(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) ctx.CreateEnrollAndStartEdgeRouter() - _, hostContext := ctx.AdminSession.RequireCreateSdkContext() + _, hostContext := ctx.AdminManagementSession.RequireCreateSdkContext() defer hostContext.Close() listener, err := hostContext.Listen(service.Name) @@ -59,7 +59,7 @@ func Test_Dataflow(t *testing.T) { }) testServer.start() - _, clientContext := ctx.AdminSession.RequireCreateSdkContext() + _, clientContext := ctx.AdminManagementSession.RequireCreateSdkContext() defer clientContext.Close() conn := ctx.WrapConn(clientContext.Dial(service.Name)) diff --git a/tests/edge_router_policy_test.go b/tests/edge_router_policy_test.go index 836d1aca1..a595170a1 100644 --- a/tests/edge_router_policy_test.go +++ b/tests/edge_router_policy_test.go @@ -28,71 +28,71 @@ func Test_EdgeRouterPolicy(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() edgeRouterRole1 := eid.New() edgeRouterRole2 := eid.New() identityRole1 := eid.New() identityRole2 := eid.New() - edgeRouter1 := ctx.AdminSession.requireNewEdgeRouter(edgeRouterRole1) - edgeRouter2 := ctx.AdminSession.requireNewEdgeRouter(edgeRouterRole1, edgeRouterRole2) - edgeRouter3 := ctx.AdminSession.requireNewEdgeRouter() + edgeRouter1 := ctx.AdminManagementSession.requireNewEdgeRouter(edgeRouterRole1) + edgeRouter2 := ctx.AdminManagementSession.requireNewEdgeRouter(edgeRouterRole1, edgeRouterRole2) + edgeRouter3 := ctx.AdminManagementSession.requireNewEdgeRouter() - identity1 := ctx.AdminSession.requireNewIdentity(false, identityRole1) - identity2 := ctx.AdminSession.requireNewIdentity(false, identityRole1, identityRole2) - identity3 := ctx.AdminSession.requireNewIdentity(false, identityRole2) + identity1 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole1) + identity2 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole1, identityRole2) + identity3 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole2) - policy1 := ctx.AdminSession.requireNewEdgeRouterPolicy(s("#"+edgeRouterRole1), s("#"+identityRole1)) - policy2 := ctx.AdminSession.requireNewEdgeRouterPolicy(s("#"+edgeRouterRole1, "@"+edgeRouter3.id), s("#"+identityRole1, "@"+identity3.Id)) - policy3 := ctx.AdminSession.requireNewEdgeRouterPolicy(s("@"+edgeRouter2.id, "@"+edgeRouter3.id), s("@"+identity2.Id, "@"+identity3.Id)) - policy4 := ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) - policy5 := ctx.AdminSession.requireNewEdgeRouterPolicyWithSemantic("AllOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+identityRole1, "#"+identityRole2)) - policy6 := ctx.AdminSession.requireNewEdgeRouterPolicyWithSemantic("AnyOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+identityRole1, "#"+identityRole2)) + policy1 := ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#"+edgeRouterRole1), s("#"+identityRole1)) + policy2 := ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#"+edgeRouterRole1, "@"+edgeRouter3.id), s("#"+identityRole1, "@"+identity3.Id)) + policy3 := ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("@"+edgeRouter2.id, "@"+edgeRouter3.id), s("@"+identity2.Id, "@"+identity3.Id)) + policy4 := ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) + policy5 := ctx.AdminManagementSession.requireNewEdgeRouterPolicyWithSemantic("AllOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+identityRole1, "#"+identityRole2)) + policy6 := ctx.AdminManagementSession.requireNewEdgeRouterPolicyWithSemantic("AnyOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+identityRole1, "#"+identityRole2)) t.Run("policy 1 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithQuery(policy1) + ctx.AdminManagementSession.validateEntityWithQuery(policy1) }) t.Run("policy 2 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithLookup(policy2) + ctx.AdminManagementSession.validateEntityWithLookup(policy2) }) t.Run("policy 3 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithLookup(policy3) + ctx.AdminManagementSession.validateEntityWithLookup(policy3) }) t.Run("policy 4 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithLookup(policy4) + ctx.AdminManagementSession.validateEntityWithLookup(policy4) }) t.Run("policy 5 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithLookup(policy5) + ctx.AdminManagementSession.validateEntityWithLookup(policy5) }) t.Run("policy 6 created", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateEntityWithLookup(policy6) + ctx.AdminManagementSession.validateEntityWithLookup(policy6) }) t.Run("policy 1 has edge routers 1, 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy1, "edge-routers", edgeRouter1, edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy1, "edge-routers", edgeRouter1, edgeRouter2) }) t.Run("policy 2 has edge routers 1, 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy2, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociations(policy2, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) }) t.Run("policy 2 has display information", func(t *testing.T) { ctx.testContextChanged(t) url := fmt.Sprintf("%v/%v", policy2.getEntityType(), policy2.getId()) - result := ctx.AdminSession.requireQuery(url) + result := ctx.AdminManagementSession.requireQuery(url) t.Run("for edge router 3 and edge router role 1", func(t *testing.T) { ctx.testContextChanged(t) @@ -157,163 +157,163 @@ func Test_EdgeRouterPolicy(t *testing.T) { t.Run("policy 3 has edge routers 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy3, "edge-routers", edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociations(policy3, "edge-routers", edgeRouter2, edgeRouter3) }) t.Run("policy 4 has edge routers 1, 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociationContains(policy4, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) }) t.Run("policy 5 has edge router 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy5, "edge-routers", edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy5, "edge-routers", edgeRouter2) }) t.Run("policy 6 has edge routers 1, 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy6, "edge-routers", edgeRouter1, edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy6, "edge-routers", edgeRouter1, edgeRouter2) }) t.Run("policy 1 has identities 1, 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy1, "identities", identity1, identity2) + ctx.AdminManagementSession.validateAssociations(policy1, "identities", identity1, identity2) }) t.Run("policy 2 has identities 1, 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy2, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy2, "identities", identity1, identity2, identity3) }) t.Run("policy 3 has identities 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy3, "identities", identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy3, "identities", identity2, identity3) }) t.Run("policy 4 has identities 1, 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociationContains(policy4, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "identities", identity1, identity2, identity3) }) t.Run("policy 5 has identity 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy5, "identities", identity2) + ctx.AdminManagementSession.validateAssociations(policy5, "identities", identity2) }) t.Run("policy 6 has identities 1, 2, 3", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy6, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy6, "identities", identity1, identity2, identity3) }) t.Run("edge router 1 has edge router policies 1, 2, 3, 4, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter1, "edge-router-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "edge-router-policies", policy1, policy2, policy4, policy6) }) t.Run("edge router 2 has edge router policies 1, 2, 3, 4, 5, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) }) t.Run("edge router 3 has edge router policies 2, 3, 4", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter3, "edge-router-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "edge-router-policies", policy2, policy3, policy4) }) t.Run("identity 1 has edge router policies 1, 2, 4, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity1, "edge-router-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "edge-router-policies", policy1, policy2, policy4, policy6) }) t.Run("identity 2 has policies 1, 2, 3, 4 ,5, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) }) t.Run("identity 3 has edge router policy 2, 3, 4, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity3, "edge-router-policies", policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "edge-router-policies", policy2, policy3, policy4, policy6) }) t.Run("updated policy 1 ", func(t *testing.T) { ctx.testContextChanged(t) policy1.edgeRouterRoles = append(policy1.edgeRouterRoles, "#"+edgeRouterRole2) policy1.identityRoles = s("#" + identityRole2) - ctx.AdminSession.requireUpdateEntity(policy1) + ctx.AdminManagementSession.requireUpdateEntity(policy1) t.Run("has edge router 2 and not 1", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy1, "edge-routers", edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy1, "edge-routers", edgeRouter2) }) t.Run("policy 1 has identities 2, 3 and not 1", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(policy1, "identities", identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy1, "identities", identity2, identity3) }) t.Run("edge router 1 has edge router policies 2, 4, 6 and not 1", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter1, "edge-router-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "edge-router-policies", policy2, policy4, policy6) }) t.Run("edge router 2 retained edge router policies 1, 2 ,3 ,4 ,5, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) }) t.Run("edge router 3 retained edge router policies: 2, 3, 4", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter3, "edge-router-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "edge-router-policies", policy2, policy3, policy4) }) t.Run("identity 1 retained edge router policies 2, 4, 6 but not 1", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity1, "edge-router-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "edge-router-policies", policy2, policy4, policy6) }) t.Run("identity 2 retained edge router policies 1, 2, 3, 4, 5, 6", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) }) t.Run("identity 3 retained edge router policies 2, 3, 4, 6 and gained 1", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity3, "edge-router-policies", policy1, policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "edge-router-policies", policy1, policy2, policy3, policy4, policy6) }) }) t.Run("delete policy 2", func(t *testing.T) { - ctx.AdminSession.requireDeleteEntity(policy2) + ctx.AdminManagementSession.requireDeleteEntity(policy2) t.Run("edge router 1 has edge router policies 4, 6 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter1, "edge-router-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "edge-router-policies", policy4, policy6) }) t.Run("edge router 2 has edge router policies 1, 3, 4, 5, 6 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "edge-router-policies", policy1, policy3, policy4, policy5, policy6) }) t.Run("edge router 3 has edge router policies 3, 4 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(edgeRouter3, "edge-router-policies", policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "edge-router-policies", policy3, policy4) }) t.Run("identity 1 retained edge router policies 4, 6 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity1, "edge-router-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "edge-router-policies", policy4, policy6) }) t.Run("identity 2 retained edge router policies 1, 3, 4, 5, 6 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity2, "edge-router-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "edge-router-policies", policy1, policy3, policy4, policy5, policy6) }) t.Run("identity 3 retained edge router policies 1, 3 , 4, 6 and not 2", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.validateAssociations(identity3, "edge-router-policies", policy1, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "edge-router-policies", policy1, policy3, policy4, policy6) }) }) diff --git a/tests/edge_router_test.go b/tests/edge_router_test.go index ab2ed241c..55ed4d185 100644 --- a/tests/edge_router_test.go +++ b/tests/edge_router_test.go @@ -30,16 +30,16 @@ func Test_EdgeRouter(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("role attributes should be created", func(t *testing.T) { ctx.testContextChanged(t) role1 := eid.New() role2 := eid.New() edgeRouter := newTestEdgeRouter(role1, role2) - edgeRouter.id = ctx.AdminSession.requireCreateEntity(edgeRouter) - ctx.AdminSession.validateEntityWithQuery(edgeRouter) - ctx.AdminSession.validateEntityWithLookup(edgeRouter) + edgeRouter.id = ctx.AdminManagementSession.requireCreateEntity(edgeRouter) + ctx.AdminManagementSession.validateEntityWithQuery(edgeRouter) + ctx.AdminManagementSession.validateEntityWithLookup(edgeRouter) }) t.Run("role attributes should be updated", func(t *testing.T) { @@ -47,12 +47,12 @@ func Test_EdgeRouter(t *testing.T) { role1 := eid.New() role2 := eid.New() edgeRouter := newTestEdgeRouter(role1, role2) - edgeRouter.id = ctx.AdminSession.requireCreateEntity(edgeRouter) + edgeRouter.id = ctx.AdminManagementSession.requireCreateEntity(edgeRouter) role3 := eid.New() edgeRouter.roleAttributes = []string{role2, role3} - ctx.AdminSession.requireUpdateEntity(edgeRouter) - ctx.AdminSession.validateEntityWithLookup(edgeRouter) + ctx.AdminManagementSession.requireUpdateEntity(edgeRouter) + ctx.AdminManagementSession.validateEntityWithLookup(edgeRouter) }) t.Run("role attributes should be queryable", func(t *testing.T) { @@ -64,18 +64,18 @@ func Test_EdgeRouter(t *testing.T) { role4 := prefix + "field-ops" role5 := prefix + "executive" - ctx.AdminSession.requireNewEdgeRouter(role1, role2) - ctx.AdminSession.requireNewEdgeRouter(role2, role3) - ctx.AdminSession.requireNewEdgeRouter(role3, role4) - edgeRouter := ctx.AdminSession.requireNewEdgeRouter(role5) - ctx.AdminSession.requireNewEdgeRouter() + ctx.AdminManagementSession.requireNewEdgeRouter(role1, role2) + ctx.AdminManagementSession.requireNewEdgeRouter(role2, role3) + ctx.AdminManagementSession.requireNewEdgeRouter(role3, role4) + edgeRouter := ctx.AdminManagementSession.requireNewEdgeRouter(role5) + ctx.AdminManagementSession.requireNewEdgeRouter() - list := ctx.AdminSession.requireList("edge-router-role-attributes") + list := ctx.AdminManagementSession.requireList("edge-router-role-attributes") ctx.Req.True(len(list) >= 5) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4, role5)) filter := url.QueryEscape(`id contains "e" and id contains "` + prefix + `" sort by id`) - list = ctx.AdminSession.requireList("edge-router-role-attributes?filter=" + filter) + list = ctx.AdminManagementSession.requireList("edge-router-role-attributes?filter=" + filter) ctx.Req.Equal(4, len(list)) expected := []string{role1, role3, role4, role5} @@ -83,8 +83,8 @@ func Test_EdgeRouter(t *testing.T) { ctx.Req.Equal(expected, list) edgeRouter.roleAttributes = nil - ctx.AdminSession.requireUpdateEntity(edgeRouter) - list = ctx.AdminSession.requireList("edge-router-role-attributes") + ctx.AdminManagementSession.requireUpdateEntity(edgeRouter) + list = ctx.AdminManagementSession.requireList("edge-router-role-attributes") ctx.Req.True(len(list) >= 4) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4)) ctx.Req.False(stringz.Contains(list, role5)) @@ -93,8 +93,8 @@ func Test_EdgeRouter(t *testing.T) { t.Run("newly created edge routers that is deleted", func(t *testing.T) { ctx.testContextChanged(t) - edgeRouter := ctx.AdminSession.requireNewEdgeRouter() + edgeRouter := ctx.AdminManagementSession.requireNewEdgeRouter() - ctx.AdminSession.requireDeleteEntity(edgeRouter) + ctx.AdminManagementSession.requireDeleteEntity(edgeRouter) }) } diff --git a/tests/enrollment_ca_auto_test.go b/tests/enrollment_ca_auto_test.go index 8e90f7c24..1afd9a23c 100644 --- a/tests/enrollment_ca_auto_test.go +++ b/tests/enrollment_ca_auto_test.go @@ -40,7 +40,7 @@ func Test_IdentityEnrollment(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("ca auto enrollment", func(t *testing.T) { @@ -48,10 +48,10 @@ func Test_IdentityEnrollment(t *testing.T) { testCa := newTestCa() ctx.testContextChanged(t) - testCaId := ctx.AdminSession.requireCreateEntity(testCa) + testCaId := ctx.AdminManagementSession.requireCreateEntity(testCa) ctx.Req.NotEmpty(testCaId) - caContainer := ctx.AdminSession.requireQuery("cas/" + testCaId) + caContainer := ctx.AdminManagementSession.requireQuery("cas/" + testCaId) ctx.Req.NotEmpty(caContainer) token := caContainer.Path("data.verificationToken").Data().(string) @@ -66,7 +66,7 @@ func Test_IdentityEnrollment(t *testing.T) { } verifyPem := pem.EncodeToMemory(verificationBlock) - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetHeader("content-type", "text/plain").SetBody(verifyPem).Post("cas/" + testCaId + "/verify") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetHeader("content-type", "text/plain").SetBody(verifyPem).Post("cas/" + testCaId + "/verify") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -75,7 +75,7 @@ func Test_IdentityEnrollment(t *testing.T) { cert, key, err := generateCaSignedClientCert(testCa.publicCert, testCa.privateKey, "test-can-enroll-"+eid.New()) ctx.Req.NoError(err) - restClient, _, transport := ctx.NewClientComponents() + restClient, _, transport := ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = []tls.Certificate{ { Certificate: [][]byte{cert.Raw}, @@ -103,7 +103,7 @@ func Test_IdentityEnrollment(t *testing.T) { cert, key, err := generateCaSignedClientCert(testCa.publicCert, testCa.privateKey, "test-can-enroll-"+eid.New()) ctx.Req.NoError(err) - restClient, _, transport := ctx.NewClientComponents() + restClient, _, transport := ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = []tls.Certificate{ { Certificate: [][]byte{cert.Raw}, @@ -133,7 +133,7 @@ func Test_IdentityEnrollment(t *testing.T) { cert, key, err := generateCaSignedClientCert(testCa.publicCert, testCa.privateKey, "test-can-enroll-"+eid.New()) ctx.Req.NoError(err) - restClient, _, transport := ctx.NewClientComponents() + restClient, _, transport := ctx.NewClientComponents(EdgeClientApiPath) transport.TLSClientConfig.Certificates = []tls.Certificate{ { Certificate: [][]byte{cert.Raw}, diff --git a/tests/enrollment_router_test.go b/tests/enrollment_router_test.go index ba2cae09c..be84b2024 100644 --- a/tests/enrollment_router_test.go +++ b/tests/enrollment_router_test.go @@ -43,18 +43,18 @@ func Test_RouterEnrollment(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("a edge router", func(t *testing.T) { ctx.testContextChanged(t) t.Run("that is newly created", func(t *testing.T) { ctx.testContextChanged(t) - edgeRouter := ctx.AdminSession.requireNewEdgeRouter() + edgeRouter := ctx.AdminManagementSession.requireNewEdgeRouter() t.Run("is unenrolled", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) ctx.Req.NoError(err) @@ -88,7 +88,7 @@ func Test_RouterEnrollment(t *testing.T) { ctx.Req.Error(err, "expected remote error bad TLS certificate") }) - t.Run("connecting to the control cahnnel with ca signed client cert and not enrolled fails", func(t *testing.T) { + t.Run("connecting to the control channel with ca signed client cert and not enrolled fails", func(t *testing.T) { ctx.testContextChanged(t) ctx.testContextChanged(t) @@ -120,7 +120,7 @@ func Test_RouterEnrollment(t *testing.T) { ctx.Req.NoError(err) ctx.Req.NotNil(randomToken) - resp, err := ctx.newRequest().SetBody("{}").Post("/enroll?method=erott&token=" + randomToken.String()) + resp, err := ctx.newAnonymousClientApiRequest().SetBody("{}").Post("/enroll?method=erott&token=" + randomToken.String()) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "INVALID_ENROLLMENT_TOKEN", http.StatusBadRequest, t) @@ -131,7 +131,7 @@ func Test_RouterEnrollment(t *testing.T) { ctx.testContextChanged(t) //get token - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) ctx.Req.NoError(err) @@ -151,7 +151,7 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "MISSING_OR_INVALID_CSR", http.StatusBadRequest, t) @@ -162,10 +162,10 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set("", "serverCertCsr") - bodyContainer.Set("", "certCsr") + _, _ = bodyContainer.Set("", "serverCertCsr") + _, _ = bodyContainer.Set("", "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "COULD_NOT_PROCESS_CSR", http.StatusBadRequest, t) @@ -176,10 +176,10 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set("", "serverCertCsr") - bodyContainer.Set("", "certCsr") + _, _ = bodyContainer.Set("", "serverCertCsr") + _, _ = bodyContainer.Set("", "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "COULD_NOT_PROCESS_CSR", http.StatusBadRequest, t) @@ -195,9 +195,9 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set(clientCsrPem, "certCsr") + _, _ = bodyContainer.Set(clientCsrPem, "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "MISSING_OR_INVALID_CSR", http.StatusBadRequest, t) @@ -213,10 +213,10 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set("", "serverCertCsr") - bodyContainer.Set(clientCsrPem, "certCsr") + _, _ = bodyContainer.Set("", "serverCertCsr") + _, _ = bodyContainer.Set(clientCsrPem, "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "COULD_NOT_PROCESS_CSR", http.StatusBadRequest, t) @@ -232,9 +232,9 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set(serverCsrPem, "serverCertCsr") + _, _ = bodyContainer.Set(serverCsrPem, "serverCertCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "MISSING_OR_INVALID_CSR", http.StatusBadRequest, t) @@ -250,10 +250,10 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set(serverCsrPem, "serverCertCsr") - bodyContainer.Set("", "certCsr") + _, _ = bodyContainer.Set(serverCsrPem, "serverCertCsr") + _, _ = bodyContainer.Set("", "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "COULD_NOT_PROCESS_CSR", http.StatusBadRequest, t) @@ -274,10 +274,10 @@ func Test_RouterEnrollment(t *testing.T) { bodyContainer := gabs.New() - bodyContainer.Set(serverCsrPem, "serverCertCsr") - bodyContainer.Set(clientCsrPem, "certCsr") + _, _ = bodyContainer.Set(serverCsrPem, "serverCertCsr") + _, _ = bodyContainer.Set(clientCsrPem, "certCsr") - resp, err := ctx.newRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(bodyContainer.String()).Post("/enroll?method=erott&token=" + enrollmentToken) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -306,7 +306,7 @@ func Test_RouterEnrollment(t *testing.T) { t.Run("is reported as enrolled", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/edge-routers/" + edgeRouter.id) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -373,7 +373,7 @@ func Test_RouterEnrollment(t *testing.T) { defer func(){ if ch != nil { - ch.Close() + _ = ch.Close() } }() @@ -388,10 +388,10 @@ func Test_RouterEnrollment(t *testing.T) { ctx.testContextChanged(t) body := gabs.New() - body.Set("", "serverCertCsr") - body.Set("", "certCsr") + _, _ = body.Set("", "serverCertCsr") + _, _ = body.Set("", "certCsr") - resp, err := ctx.newRequest().SetBody(body.String()).Post("/enroll/extend/router") + resp, err := ctx.newAnonymousClientApiRequest().SetBody(body.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, "UNAUTHORIZED", http.StatusUnauthorized, t) @@ -405,39 +405,39 @@ func Test_RouterEnrollment(t *testing.T) { resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(body.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) - standardErrorJsonResponseTests(resp, "COULD_NOT_PARSE_BODY", http.StatusBadRequest, t) + standardErrorJsonResponseTests(resp, "COULD_NOT_VALIDATE", http.StatusBadRequest, t) }) t.Run("a client CSR but missing server CSR field fails", func(t *testing.T) { ctx.testContextChanged(t) body := gabs.New() - body.Set("", "certCsr") + _, _ = body.Set("", "certCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(body.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) - standardErrorJsonResponseTests(resp, "COULD_NOT_PARSE_BODY", http.StatusBadRequest, t) + standardErrorJsonResponseTests(resp, "COULD_NOT_VALIDATE", http.StatusBadRequest, t) }) t.Run("a server CSR but missing client CSR field fails", func(t *testing.T) { ctx.testContextChanged(t) body := gabs.New() - body.Set("", "serverCertCsr") + _, _ = body.Set("", "serverCertCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(body.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) - standardErrorJsonResponseTests(resp, "COULD_NOT_PARSE_BODY", http.StatusBadRequest, t) + standardErrorJsonResponseTests(resp, "COULD_NOT_VALIDATE", http.StatusBadRequest, t) }) t.Run("an empty client and server CSR fields fails", func(t *testing.T) { ctx.testContextChanged(t) body := gabs.New() - body.Set("", "serverCertCsr") - body.Set("", "certCsr") + _, _ = body.Set("", "serverCertCsr") + _, _ = body.Set("", "certCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(body.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) @@ -456,8 +456,8 @@ func Test_RouterEnrollment(t *testing.T) { extensionBodyContainer := gabs.New() - extensionBodyContainer.Set("", "serverCertCsr") - extensionBodyContainer.Set(extensionClientCsrPem, "certCsr") + _, _ = extensionBodyContainer.Set("", "serverCertCsr") + _, _ = extensionBodyContainer.Set(extensionClientCsrPem, "certCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(extensionBodyContainer.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) @@ -476,8 +476,8 @@ func Test_RouterEnrollment(t *testing.T) { extensionBodyContainer := gabs.New() - extensionBodyContainer.Set(extensionServerCsrPem, "serverCertCsr") - extensionBodyContainer.Set("", "certCsr") + _, _ = extensionBodyContainer.Set(extensionServerCsrPem, "serverCertCsr") + _, _ = extensionBodyContainer.Set("", "certCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(extensionBodyContainer.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) @@ -500,8 +500,8 @@ func Test_RouterEnrollment(t *testing.T) { extensionBodyContainer := gabs.New() - extensionBodyContainer.Set(extensionServerCsrPem, "serverCertCsr") - extensionBodyContainer.Set(extensionClientCsrPem, "certCsr") + _, _ = extensionBodyContainer.Set(extensionServerCsrPem, "serverCertCsr") + _, _ = extensionBodyContainer.Set(extensionClientCsrPem, "certCsr") resp, err := ctx.newRequestWithClientCert(cert, privateKey).SetBody(extensionBodyContainer.String()).Post("/enroll/extend/router") ctx.Req.NoError(err) @@ -555,7 +555,7 @@ func Test_RouterEnrollment(t *testing.T) { defer func(){ if ch != nil { - ch.Close() + _ = ch.Close() } }() ctx.Req.Error(err) @@ -572,7 +572,7 @@ func Test_RouterEnrollment(t *testing.T) { defer func(){ if ch != nil { - ch.Close() + _ = ch.Close() } }() diff --git a/tests/enrollment_updb_test.go b/tests/enrollment_updb_test.go index 3966e2fd8..6e6781ff3 100644 --- a/tests/enrollment_updb_test.go +++ b/tests/enrollment_updb_test.go @@ -29,7 +29,7 @@ func Test_UpdbEnrollment(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("a updb enrolling identity can be created", func(t *testing.T) { ctx.testContextChanged(t) @@ -48,7 +48,7 @@ func Test_UpdbEnrollment(t *testing.T) { }, "enrollment") updbCreate.Set(false, "isAdmin") - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(updbCreate.String()).Post("/identities") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(updbCreate.String()).Post("identities") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusCreated, t) @@ -65,7 +65,7 @@ func Test_UpdbEnrollment(t *testing.T) { t.Run("created updb identity has a UPDB JWT", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/identities/" + updbId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("identities/" + updbId) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -94,7 +94,7 @@ func Test_UpdbEnrollment(t *testing.T) { enrollmentBody.Set(updbPassword, "password") - resp, err := ctx.newRequest().SetBody(enrollmentBody.String()).Post("/enroll?method=updb&token=" + updbEnrollmentToken) + resp, err := ctx.newAnonymousClientApiRequest().SetBody(enrollmentBody.String()).Post("enroll?method=updb&token=" + updbEnrollmentToken) ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -108,7 +108,7 @@ func Test_UpdbEnrollment(t *testing.T) { ConfigTypes: nil, } - updbApiSession, err := updbAuth.Authenticate(ctx) + updbApiSession, err := updbAuth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(updbApiSession) ctx.Req.NotEmpty(updbApiSession.token) @@ -116,7 +116,7 @@ func Test_UpdbEnrollment(t *testing.T) { t.Run("authenticated updb api session can query current api session", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := updbApiSession.newAuthenticatedRequest().Get("/current-api-session") + resp, err := updbApiSession.newAuthenticatedRequest().Get("current-api-session") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) diff --git a/tests/entities.go b/tests/entities.go index 4015831e8..2c4641630 100644 --- a/tests/entities.go +++ b/tests/entities.go @@ -333,11 +333,9 @@ func (entity *identity) validate(ctx *TestContext, c *gabs.Container) { } else { ctx.pathEquals(c, "default", path("defaultHostingPrecedence")) } - if entity.defaultHostingCost == 0 { - ctx.pathEquals(c, nil, path("defaultHostingCost")) - } else { - ctx.pathEquals(c, entity.defaultHostingCost, path("defaultHostingCost")) - } + + ctx.pathEquals(c, entity.defaultHostingCost, path("defaultHostingCost")) + sort.Strings(entity.roleAttributes) ctx.pathEqualsStringSlice(c, entity.roleAttributes, path("roleAttributes")) ctx.pathEquals(c, entity.tags, path("tags")) diff --git a/tests/events_test.go b/tests/events_test.go index 15662cf22..2abc50a64 100644 --- a/tests/events_test.go +++ b/tests/events_test.go @@ -96,13 +96,17 @@ func Test_EventsTest(t *testing.T) { defer unregisterUsageEventsHandler() ctx.StartServer() - ctx.RequireAdminLogin() - ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + ctx.RequireAdminManagementApiLogin() + ctx.RequireAdminClientApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - hostIdentity, hostContext := ctx.AdminSession.RequireCreateSdkContext() + + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll(xt_smartrouting.Name) + + ctx.CreateEnrollAndStartEdgeRouter() + + hostIdentity, hostContext := ctx.AdminManagementSession.RequireCreateSdkContext() defer hostContext.Close() listener, err := hostContext.Listen(service.Name) @@ -115,7 +119,7 @@ func Test_EventsTest(t *testing.T) { }) testServer.start() - clientIdentity, clientContext := ctx.AdminSession.RequireCreateSdkContext() + clientIdentity, clientContext := ctx.AdminManagementSession.RequireCreateSdkContext() defer clientContext.Close() conn := ctx.WrapConn(clientContext.Dial(service.Name)) diff --git a/tests/identity_test.go b/tests/identity_test.go index 6a7950c73..07d614c34 100644 --- a/tests/identity_test.go +++ b/tests/identity_test.go @@ -33,22 +33,22 @@ func Test_Identity(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("role attributes should be created", func(t *testing.T) { ctx.testContextChanged(t) role1 := eid.New() role2 := eid.New() identity := newTestIdentity(false, role1, role2) - identity.Id = ctx.AdminSession.requireCreateEntity(identity) - ctx.AdminSession.validateEntityWithQuery(identity) - ctx.AdminSession.validateEntityWithLookup(identity) + identity.Id = ctx.AdminManagementSession.requireCreateEntity(identity) + ctx.AdminManagementSession.validateEntityWithQuery(identity) + ctx.AdminManagementSession.validateEntityWithLookup(identity) }) t.Run("service hosting values should be set", func(t *testing.T) { ctx.testContextChanged(t) - svc1 := ctx.AdminSession.requireNewService(nil, nil) - svc2 := ctx.AdminSession.requireNewService(nil, nil) + svc1 := ctx.AdminManagementSession.requireNewService(nil, nil) + svc2 := ctx.AdminManagementSession.requireNewService(nil, nil) identity := newTestIdentity(false) identity.defaultHostingPrecedence = "required" @@ -63,9 +63,9 @@ func Test_Identity(t *testing.T) { svc2.Id: 300, } - identity.Id = ctx.AdminSession.requireCreateEntity(identity) - ctx.AdminSession.validateEntityWithQuery(identity) - ctx.AdminSession.validateEntityWithLookup(identity) + identity.Id = ctx.AdminManagementSession.requireCreateEntity(identity) + ctx.AdminManagementSession.validateEntityWithQuery(identity) + ctx.AdminManagementSession.validateEntityWithLookup(identity) }) t.Run("role attributes should be updated", func(t *testing.T) { @@ -73,12 +73,12 @@ func Test_Identity(t *testing.T) { role1 := eid.New() role2 := eid.New() identity := newTestIdentity(false, role1, role2) - identity.Id = ctx.AdminSession.requireCreateEntity(identity) + identity.Id = ctx.AdminManagementSession.requireCreateEntity(identity) role3 := eid.New() identity.roleAttributes = []string{role2, role3} - ctx.AdminSession.requireUpdateEntity(identity) - ctx.AdminSession.validateEntityWithLookup(identity) + ctx.AdminManagementSession.requireUpdateEntity(identity) + ctx.AdminManagementSession.validateEntityWithLookup(identity) }) t.Run("role attributes should not be changed on PATCH if not sent", func(t *testing.T) { @@ -86,19 +86,19 @@ func Test_Identity(t *testing.T) { role1 := eid.New() role2 := eid.New() identity := newTestIdentity(false, role1, role2) - identity.Id = ctx.AdminSession.requireCreateEntity(identity) + identity.Id = ctx.AdminManagementSession.requireCreateEntity(identity) patchContainer := gabs.New() newName := uuid.New().String() _, _ = patchContainer.Set(newName, "name") identity.name = newName - resp := ctx.AdminSession.updateEntityOfType(identity.Id, identity.getEntityType(), patchContainer.String(), true) + resp := ctx.AdminManagementSession.updateEntityOfType(identity.Id, identity.getEntityType(), patchContainer.String(), true) ctx.Req.NotNil(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + identity.Id) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + identity.Id) ctx.Req.Equal(newName, updatedIdentity.Path("data.name").Data().(string), "name should be updated") @@ -120,19 +120,19 @@ func Test_Identity(t *testing.T) { role1 := eid.New() role2 := eid.New() identity := newTestIdentity(false, role1, role2) - identity.Id = ctx.AdminSession.requireCreateEntity(identity) + identity.Id = ctx.AdminManagementSession.requireCreateEntity(identity) patchContainer := gabs.New() role3 := eid.New() _, _ = patchContainer.Set([]string{role1, role2, role3}, "roleAttributes") - resp := ctx.AdminSession.updateEntityOfType(identity.Id, identity.getEntityType(), patchContainer.String(), true) + resp := ctx.AdminManagementSession.updateEntityOfType(identity.Id, identity.getEntityType(), patchContainer.String(), true) ctx.Req.NotNil(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + identity.Id) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + identity.Id) updateAttributes, err := updatedIdentity.Path("data.roleAttributes").Children() ctx.Req.NoError(err) @@ -156,18 +156,18 @@ func Test_Identity(t *testing.T) { role4 := prefix + "field-ops" role5 := prefix + "executive" - ctx.AdminSession.requireNewIdentity(false, role1, role2) - ctx.AdminSession.requireNewIdentity(false, role2, role3) - ctx.AdminSession.requireNewIdentity(false, role3, role4) - identity := ctx.AdminSession.requireNewIdentity(false, role5) - ctx.AdminSession.requireNewIdentity(false) + ctx.AdminManagementSession.requireNewIdentity(false, role1, role2) + ctx.AdminManagementSession.requireNewIdentity(false, role2, role3) + ctx.AdminManagementSession.requireNewIdentity(false, role3, role4) + identity := ctx.AdminManagementSession.requireNewIdentity(false, role5) + ctx.AdminManagementSession.requireNewIdentity(false) - list := ctx.AdminSession.requireList("identity-role-attributes") + list := ctx.AdminManagementSession.requireList("identity-role-attributes") ctx.Req.True(len(list) >= 5) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4, role5)) filter := url.QueryEscape(`id contains "e" and id contains "` + prefix + `" sort by id`) - list = ctx.AdminSession.requireList("identity-role-attributes?filter=" + filter) + list = ctx.AdminManagementSession.requireList("identity-role-attributes?filter=" + filter) ctx.Req.Equal(4, len(list)) expected := []string{role1, role3, role4, role5} @@ -175,8 +175,8 @@ func Test_Identity(t *testing.T) { ctx.Req.Equal(expected, list) identity.roleAttributes = nil - ctx.AdminSession.requireUpdateEntity(identity) - list = ctx.AdminSession.requireList("identity-role-attributes") + ctx.AdminManagementSession.requireUpdateEntity(identity) + list = ctx.AdminManagementSession.requireList("identity-role-attributes") ctx.Req.True(len(list) >= 4) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4)) ctx.Req.False(stringz.Contains(list, role5)) @@ -184,11 +184,11 @@ func Test_Identity(t *testing.T) { t.Run("update (PUT) an identity", func(t *testing.T) { ctx.testContextChanged(t) - enrolledId, _ := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false) - enrolledIdentity := ctx.AdminSession.requireQuery("identities/" + enrolledId) + enrolledId, _ := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false) + enrolledIdentity := ctx.AdminManagementSession.requireQuery("identities/" + enrolledId) - unenrolledId := ctx.AdminSession.requireCreateIdentityOttEnrollmentUnfinished(eid.New(), false) - unenrolledIdentity := ctx.AdminSession.requireQuery("identities/" + unenrolledId) + unenrolledId := ctx.AdminManagementSession.requireCreateIdentityOttEnrollmentUnfinished(eid.New(), false) + unenrolledIdentity := ctx.AdminManagementSession.requireQuery("identities/" + unenrolledId) t.Run("should not alter authenticators", func(t *testing.T) { ctx.testContextChanged(t) @@ -198,10 +198,10 @@ func Test_Identity(t *testing.T) { _, _ = updateContent.SetP(map[string]interface{}{}, "tags") _, _ = updateContent.SetP(false, "isAdmin") - resp := ctx.AdminSession.updateEntityOfType(enrolledId, "identities", updateContent.String(), false) + resp := ctx.AdminManagementSession.updateEntityOfType(enrolledId, "identities", updateContent.String(), false) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + enrolledId) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + enrolledId) data := enrolledIdentity.Path("data.authenticators").Data() expectedAuths := data.(map[string]interface{}) @@ -220,10 +220,10 @@ func Test_Identity(t *testing.T) { _, _ = updateContent.SetP(map[string]interface{}{}, "tags") _, _ = updateContent.SetP(false, "isAdmin") - resp := ctx.AdminSession.updateEntityOfType(unenrolledId, "identities", updateContent.String(), false) + resp := ctx.AdminManagementSession.updateEntityOfType(unenrolledId, "identities", updateContent.String(), false) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + unenrolledId) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + unenrolledId) expectedEnrollments := unenrolledIdentity.Path("data.enrollment").Data().(map[string]interface{}) ctx.Req.NotEmpty(expectedEnrollments) @@ -236,7 +236,7 @@ func Test_Identity(t *testing.T) { t.Run("should not allow isDefaultAdmin to be altered", func(t *testing.T) { ctx.testContextChanged(t) - identityId := ctx.AdminSession.requireCreateIdentity(eid.New(), true) + identityId := ctx.AdminManagementSession.requireCreateIdentity(eid.New(), true) updateContent := gabs.New() _, _ = updateContent.SetP(eid.New(), "name") @@ -245,10 +245,10 @@ func Test_Identity(t *testing.T) { _, _ = updateContent.SetP(true, "isAdmin") _, _ = updateContent.SetP(true, "isDefaultAdmin") - resp := ctx.AdminSession.updateEntityOfType(identityId, "identities", updateContent.String(), false) + resp := ctx.AdminManagementSession.updateEntityOfType(identityId, "identities", updateContent.String(), false) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + unenrolledId) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + unenrolledId) ctx.Req.Equal(true, updatedIdentity.ExistsP("data.isDefaultAdmin")) isDefaultAdmin := updatedIdentity.Path("data.isDefaultAdmin").Data().(bool) @@ -257,7 +257,7 @@ func Test_Identity(t *testing.T) { t.Run("can update", func(t *testing.T) { ctx.testContextChanged(t) - identityId := ctx.AdminSession.requireCreateIdentity(eid.New(), true) + identityId := ctx.AdminManagementSession.requireCreateIdentity(eid.New(), true) newName := eid.New() updateContent := gabs.New() @@ -266,10 +266,10 @@ func Test_Identity(t *testing.T) { _, _ = updateContent.SetP(map[string]interface{}{}, "tags") _, _ = updateContent.SetP(false, "isAdmin") - resp := ctx.AdminSession.updateEntityOfType(identityId, "identities", updateContent.String(), false) + resp := ctx.AdminManagementSession.updateEntityOfType(identityId, "identities", updateContent.String(), false) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedIdentity := ctx.AdminSession.requireQuery("identities/" + identityId) + updatedIdentity := ctx.AdminManagementSession.requireQuery("identities/" + identityId) t.Run("name", func(t *testing.T) { ctx.testContextChanged(t) @@ -291,11 +291,11 @@ func Test_Identity(t *testing.T) { t.Run("hasApiSessions", func(t *testing.T) { ctx.testContextChanged(t) - identityId, identityAuth := ctx.AdminSession.requireCreateIdentityOttEnrollment("identityHasApiSessionTest", false) + identityId, identityAuth := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment("identityHasApiSessionTest", false) t.Run("should be false if there are no API Sessions", func(t *testing.T) { ctx.testContextChanged(t) - identityContainer := ctx.AdminSession.requireQuery("/identities/" + identityId) + identityContainer := ctx.AdminManagementSession.requireQuery("/identities/" + identityId) ctx.Req.True(identityContainer.ExistsP("data.hasApiSession"), "expected field hasApiSession to exist") ctx.Req.False(identityContainer.Path("data.hasApiSession").Data().(bool), "expected hasApiSession to be false") @@ -304,32 +304,32 @@ func Test_Identity(t *testing.T) { t.Run("should be true if there is 1 API Session", func(t *testing.T) { ctx.testContextChanged(t) - session1, err := identityAuth.Authenticate(ctx) + session1, err := identityAuth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotNil(session1) - identityContainer := ctx.AdminSession.requireQuery("/identities/" + identityId) + identityContainer := ctx.AdminManagementSession.requireQuery("/identities/" + identityId) ctx.Req.True(identityContainer.ExistsP("data.hasApiSession"), "expected field hasApiSession to exist") ctx.Req.True(identityContainer.Path("data.hasApiSession").Data().(bool), "expected hasApiSession to be true") t.Run("should be true if there is 1+ API Session", func(t *testing.T) { ctx.testContextChanged(t) - session2, err := identityAuth.Authenticate(ctx) + session2, err := identityAuth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotNil(session2) - identityContainer := ctx.AdminSession.requireQuery("/identities/" + identityId) + identityContainer := ctx.AdminManagementSession.requireQuery("/identities/" + identityId) ctx.Req.True(identityContainer.ExistsP("data.hasApiSession"), "expected field hasApiSession to exist") ctx.Req.True(identityContainer.Path("data.hasApiSession").Data().(bool), "expected hasApiSession to be true") t.Run("should return to false after logouts", func(t *testing.T) { ctx.testContextChanged(t) - session1.logout() - session2.logout() + _ = session1.logout() + _ = session2.logout() - identityContainer := ctx.AdminSession.requireQuery("/identities/" + identityId) + identityContainer := ctx.AdminManagementSession.requireQuery("/identities/" + identityId) ctx.Req.True(identityContainer.ExistsP("data.hasApiSession"), "expected field hasApiSession to exist") ctx.Req.False(identityContainer.Path("data.hasApiSession").Data().(bool), "expected hasApiSession to be false") diff --git a/tests/mfa_ziti_test.go b/tests/mfa_ziti_test.go index 35479ae34..5cb1c02c4 100644 --- a/tests/mfa_ziti_test.go +++ b/tests/mfa_ziti_test.go @@ -38,14 +38,14 @@ func Test_MFA(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() t.Run("if mfa is not enrolled", func(t *testing.T) { ctx.testContextChanged(t) - noMfaIdentityId, noMfaIdentity := ctx.AdminSession.requireCreateIdentityOttEnrollment("mfa_ziti_test_no_mfa", false) - noMfaSession, err := noMfaIdentity.Authenticate(ctx) + noMfaIdentityId, noMfaIdentity := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment("mfa_ziti_test_no_mfa", false) + noMfaSession, err := noMfaIdentity.AuthenticateClientApi(ctx) ctx.Req.NoError(err) t.Run("current identity", func(t *testing.T) { @@ -126,7 +126,7 @@ func Test_MFA(t *testing.T) { t.Run("admin identity endpoint", func(t *testing.T) { t.Run("get MFA should have isMfaEnabled flag set to false", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", noMfaIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", noMfaIdentityId)) ctx.Req.NoError(err) @@ -147,7 +147,7 @@ func Test_MFA(t *testing.T) { t.Run("delete MFA should 404", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Delete(fmt.Sprintf("/identities/%s/mfa", noMfaIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Delete(fmt.Sprintf("/identities/%s/mfa", noMfaIdentityId)) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, errorz.NotFoundCode, http.StatusNotFound, t) @@ -165,8 +165,8 @@ func Test_MFA(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - mfaStartedIdentityId, noMfaIdentity = ctx.AdminSession.requireCreateIdentityOttEnrollment(mfaStartedIdentityName, false) - mfaStartedSession, err = noMfaIdentity.Authenticate(ctx) + mfaStartedIdentityId, noMfaIdentity = ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(mfaStartedIdentityName, false) + mfaStartedSession, err = noMfaIdentity.AuthenticateClientApi(ctx) ctx.Req.NoError(err) }) @@ -216,18 +216,18 @@ func Test_MFA(t *testing.T) { provisionString := ctx.RequireGetNonNilPathValue(mfa, "data.provisioningUrl").Data().(string) ctx.Req.NotEmpty(provisionString) - url, err := url.Parse(provisionString) + mfaUrl, err := url.Parse(provisionString) ctx.Req.NoError(err) - ctx.Req.Equal(url.Host, "totp") - ctx.Req.Equal(url.Path, "/ziti.dev:"+mfaStartedIdentityName) - ctx.Req.Equal(url.Scheme, "otpauth") + ctx.Req.Equal(mfaUrl.Host, "totp") + ctx.Req.Equal(mfaUrl.Path, "/ziti.dev:"+mfaStartedIdentityName) + ctx.Req.Equal(mfaUrl.Scheme, "otpauth") }) }) t.Run("and for the admin identity endpoint", func(t *testing.T) { t.Run("get MFA should have isMfaEnabled flag set to false", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfaStartedIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfaStartedIdentityId)) ctx.Req.NoError(err) @@ -248,7 +248,7 @@ func Test_MFA(t *testing.T) { t.Run("delete MFA should fail with 404", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Delete(fmt.Sprintf("/identities/%s/mfa", mfaStartedIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Delete(fmt.Sprintf("/identities/%s/mfa", mfaStartedIdentityId)) ctx.Req.NoError(err) standardErrorJsonResponseTests(resp, errorz.NotFoundCode, http.StatusNotFound, t) @@ -287,13 +287,16 @@ func Test_MFA(t *testing.T) { t.Run("authentication with partially enrolled MFA should fully authenticate", func(t *testing.T) { ctx.testContextChanged(t) - secondMfaStartedSession, err := noMfaIdentity.Authenticate(ctx) + secondMfaStartedSession, err := noMfaIdentity.AuthenticateClientApi(ctx) ctx.Req.NoError(err) ctx.Req.NotEmpty(secondMfaStartedSession) resp, err := secondMfaStartedSession.newAuthenticatedRequest().Get("/current-api-session/") standardJsonResponseTests(resp, http.StatusOK, t) + ctx.Req.NoError(err) + ctx.Req.NotNil(resp) + currentSession, err := gabs.ParseJSON(resp.Body()) ctx.Req.NoError(err) @@ -344,8 +347,8 @@ func Test_MFA(t *testing.T) { t.Run("setup", func(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - mfaValidatedIdentityId, mfaValidatedIdentity = ctx.AdminSession.requireCreateIdentityOttEnrollment(mfaStartedIdentityName, false) - mfaValidatedSession, err = mfaValidatedIdentity.Authenticate(ctx) + mfaValidatedIdentityId, mfaValidatedIdentity = ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(mfaStartedIdentityName, false) + mfaValidatedSession, err = mfaValidatedIdentity.AuthenticateClientApi(ctx) ctx.Req.NotEmpty(mfaValidatedIdentityId) ctx.Req.NoError(err) }) @@ -408,7 +411,7 @@ func Test_MFA(t *testing.T) { resp, err := mfaValidatedSession.newAuthenticatedRequest().SetBody(`{}`).Post("/current-identity/mfa/verify") ctx.Req.NoError(err) - standardErrorJsonResponseTests(resp, apierror.CouldNotParseBodyCode, http.StatusBadRequest, t) + standardErrorJsonResponseTests(resp, "COULD_NOT_VALIDATE", http.StatusBadRequest, t) }) t.Run("with an empty code it should error with invalid token/bad request", func(t *testing.T) { @@ -448,7 +451,6 @@ func Test_MFA(t *testing.T) { ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) - t.Run("current api session should be", func(t *testing.T) { ctx.testContextChanged(t) respContainer := mfaValidatedSession.requireQuery("/current-api-session") @@ -472,7 +474,7 @@ func Test_MFA(t *testing.T) { t.Run("api session should have posture data with MFA passed", func(t *testing.T) { ctx.testContextChanged(t) - postureDataContainer := ctx.AdminSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data",mfaValidatedIdentityId)) + postureDataContainer := ctx.AdminManagementSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data", mfaValidatedIdentityId)) mfaPath := fmt.Sprintf("data.apiSessionPostureData.%s.mfa.passedMfa", mfaValidatedSession.id) postureDataContainer.ExistsP(mfaPath) isMfaPassed, ok := postureDataContainer.Path(mfaPath).Data().(bool) @@ -581,7 +583,7 @@ func Test_MFA(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - newValidatedSession, err = mfaValidatedIdentity.Authenticate(ctx) + newValidatedSession, err = mfaValidatedIdentity.AuthenticateClientApi(ctx) ctx.Req.NoError(err) }) @@ -699,7 +701,7 @@ func Test_MFA(t *testing.T) { t.Run("api session should have posture data with MFA passed", func(t *testing.T) { ctx.testContextChanged(t) - postureDataContainer := ctx.AdminSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data",newValidatedSession.identityId)) + postureDataContainer := ctx.AdminManagementSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data", newValidatedSession.identityId)) mfaPath := fmt.Sprintf("data.apiSessionPostureData.%s.mfa.passedMfa", newValidatedSession.id) postureDataContainer.ExistsP(mfaPath) isMfaPassed, ok := postureDataContainer.Path(mfaPath).Data().(bool) @@ -715,7 +717,7 @@ func Test_MFA(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - newValidatedSession, err = mfaValidatedIdentity.Authenticate(ctx) + newValidatedSession, err = mfaValidatedIdentity.AuthenticateClientApi(ctx) ctx.Req.NoError(err) }) @@ -812,7 +814,7 @@ func Test_MFA(t *testing.T) { t.Run("api session should have posture data with MFA passed", func(t *testing.T) { ctx.testContextChanged(t) - postureDataContainer := ctx.AdminSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data",newValidatedSession.identityId)) + postureDataContainer := ctx.AdminManagementSession.requireQuery(fmt.Sprintf("/identities/%s/posture-data", newValidatedSession.identityId)) mfaPath := fmt.Sprintf("data.apiSessionPostureData.%s.mfa.passedMfa", newValidatedSession.id) postureDataContainer.ExistsP(mfaPath) isMfaPassed, ok := postureDataContainer.Path(mfaPath).Data().(bool) @@ -826,7 +828,7 @@ func Test_MFA(t *testing.T) { t.Run("admin identity endpoint", func(t *testing.T) { t.Run("get MFA should have isMfaEnabled flag set to true", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfaValidatedIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfaValidatedIdentityId)) ctx.Req.NoError(err) @@ -862,8 +864,8 @@ func Test_MFA(t *testing.T) { t.Run("setup", func(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - mfa01DeleteIdentityId, mfa01Delete = ctx.AdminSession.requireCreateIdentityOttEnrollment(mfa01DeleteName, false) - mfa01DeleteSession, err = mfa01Delete.Authenticate(ctx) + mfa01DeleteIdentityId, mfa01Delete = ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(mfa01DeleteName, false) + mfa01DeleteSession, err = mfa01Delete.AuthenticateClientApi(ctx) ctx.Req.NotEmpty(mfa01DeleteIdentityId) ctx.Req.NoError(err) }) @@ -935,8 +937,8 @@ func Test_MFA(t *testing.T) { t.Run("by a non-admin it should fail", func(t *testing.T) { ctx.testContextChanged(t) - _, nonAdmin := ctx.AdminSession.requireCreateIdentityOttEnrollment(uuid.New().String(), false) - nonAdminSession, err := nonAdmin.Authenticate(ctx) + _, nonAdmin := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(uuid.New().String(), false) + nonAdminSession, err := nonAdmin.AuthenticateManagementApi(ctx) ctx.Req.NoError(err) @@ -949,14 +951,14 @@ func Test_MFA(t *testing.T) { t.Run("by an admin it should succeed", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Delete("/identities/" + mfa01DeleteIdentityId + "/mfa") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Delete("/identities/" + mfa01DeleteIdentityId + "/mfa") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) t.Run("mfaEnabled flag should be false", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfa01DeleteIdentityId)) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get(fmt.Sprintf("/identities/%s", mfa01DeleteIdentityId)) ctx.Req.NoError(err) @@ -988,8 +990,8 @@ func Test_MFA(t *testing.T) { t.Run("setup", func(t *testing.T) { t.Run("by first authenticating", func(t *testing.T) { var err error - mfa02DeleteIdentityId, mfa02Delete = ctx.AdminSession.requireCreateIdentityOttEnrollment(mfa02DeleteName, false) - mfa02DeleteSession, err = mfa02Delete.Authenticate(ctx) + mfa02DeleteIdentityId, mfa02Delete = ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(mfa02DeleteName, false) + mfa02DeleteSession, err = mfa02Delete.AuthenticateClientApi(ctx) ctx.Req.NotEmpty(mfa02DeleteIdentityId) ctx.Req.NoError(err) }) @@ -1096,7 +1098,7 @@ func computeMFACode(secret string) string { } type mfaCode struct { - Code string `json: "code"` + Code string `json:"code"` } func newMfaCodeBody(code string) []byte { diff --git a/tests/posture_check_domain_test.go b/tests/posture_check_domain_test.go index e32ec77b4..389da46a8 100644 --- a/tests/posture_check_domain_test.go +++ b/tests/posture_check_domain_test.go @@ -30,7 +30,7 @@ func Test_PostureChecks_Domain(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() t.Run("can CRUD domain posture checks", func(t *testing.T) { @@ -40,7 +40,7 @@ func Test_PostureChecks_Domain(t *testing.T) { t.Run("can create a posture check", func(t *testing.T) { ctx.testContextChanged(t) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) t.Run("created posture check can have name patched", func(t *testing.T) { ctx.testContextChanged(t) @@ -49,11 +49,11 @@ func Test_PostureChecks_Domain(t *testing.T) { _, _ = putContainer.Set(newName, "name") _, _ = putContainer.Set(postureCheck.typeId, "typeId") - resp := ctx.AdminSession.updateEntityOfType(postureCheck.id, postureCheck.getEntityType(), putContainer.String(), true) + resp := ctx.AdminManagementSession.updateEntityOfType(postureCheck.id, postureCheck.getEntityType(), putContainer.String(), true) ctx.Req.NotNil(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedContainer := ctx.AdminSession.requireQuery("/posture-checks/" + postureCheck.id) + updatedContainer := ctx.AdminManagementSession.requireQuery("/posture-checks/" + postureCheck.id) ctx.Req.Equal(newName, updatedContainer.Path("data.name").Data().(string), "name is patched") domains, err := updatedContainer.Path("data.domains").Children() @@ -73,11 +73,11 @@ func Test_PostureChecks_Domain(t *testing.T) { _, _ = putContainer.Set(tags, "tags") _, _ = putContainer.Set(postureCheck.typeId, "typeId") - resp := ctx.AdminSession.updateEntityOfType(postureCheck.id, postureCheck.getEntityType(), putContainer.String(), true) + resp := ctx.AdminManagementSession.updateEntityOfType(postureCheck.id, postureCheck.getEntityType(), putContainer.String(), true) ctx.Req.NotNil(resp) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) - updatedContainer := ctx.AdminSession.requireQuery("/posture-checks/" + postureCheck.id) + updatedContainer := ctx.AdminManagementSession.requireQuery("/posture-checks/" + postureCheck.id) updatedDomains, err := updatedContainer.Path("data.domains").Children() ctx.Req.NoError(err) @@ -91,7 +91,7 @@ func Test_PostureChecks_Domain(t *testing.T) { t.Run("created posture check can be deleted", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.requireDeleteEntity(postureCheck) + ctx.AdminManagementSession.requireDeleteEntity(postureCheck) }) }) }) @@ -103,22 +103,22 @@ func Test_PostureChecks_Domain(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) domain := "domain1" - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) - dialPolicy := ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - bindPolicy := ctx.AdminSession.requireNewServicePolicyWithSemantic("Bind", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + dialPolicy := ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + bindPolicy := ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Bind", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -307,7 +307,7 @@ func Test_PostureChecks_Domain(t *testing.T) { t.Run("providing valid posture data via bulk endpoint", func(t *testing.T) { ctx.testContextChanged(t) - newSession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + newSession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) newSession.requireNewPostureResponseBulkDomain(postureCheck.id, domain) @@ -371,22 +371,22 @@ func Test_PostureChecks_Domain(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) domain := "domain1" - _ = ctx.AdminSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) + _ = ctx.AdminManagementSession.requireNewPostureCheckDomain(s(domain), s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), nil) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), nil) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) diff --git a/tests/posture_check_mfa_test.go b/tests/posture_check_mfa_test.go index 57c04f733..6d1e61b60 100644 --- a/tests/posture_check_mfa_test.go +++ b/tests/posture_check_mfa_test.go @@ -31,7 +31,7 @@ func Test_PostureChecks_MFA(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() t.Run("can create a MFA posture check associated to a service", func(t *testing.T) { @@ -41,20 +41,20 @@ func Test_PostureChecks_MFA(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) - postureCheck := ctx.AdminSession.requireNewPostureCheckMFA(s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckMFA(s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -164,7 +164,7 @@ func Test_PostureChecks_MFA(t *testing.T) { t.Run("a new api session can pass MFA auth to create service session", func(t *testing.T) { ctx.testContextChanged(t) - newSession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + newSession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) resp, err := newSession.newAuthenticatedRequest().SetBody(newMfaCodeBody(computeMFACode(mfaSecret))).Post("/authenticate/mfa") @@ -176,11 +176,11 @@ func Test_PostureChecks_MFA(t *testing.T) { ctx.Req.NoError(err) ctx.Req.Equal(http.StatusCreated, resp.StatusCode()) - sessionConntainer, err := gabs.ParseJSON(resp.Body()) + sessionContainer, err := gabs.ParseJSON(resp.Body()) ctx.Req.NoError(err) - ctx.Req.True(sessionConntainer.ExistsP("data.id")) - sessionId, ok := sessionConntainer.Path("data.id").Data().(string) + ctx.Req.True(sessionContainer.ExistsP("data.id")) + sessionId, ok := sessionContainer.Path("data.id").Data().(string) ctx.Req.True(ok) ctx.Req.NotEmpty(sessionId) diff --git a/tests/posture_check_os_test.go b/tests/posture_check_os_test.go index d080d6e6d..4444be702 100644 --- a/tests/posture_check_os_test.go +++ b/tests/posture_check_os_test.go @@ -29,7 +29,7 @@ func Test_PostureChecks_Os(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() t.Run("can CRUD OS posture checks", func(t *testing.T) { @@ -58,7 +58,7 @@ func Test_PostureChecks_Os(t *testing.T) { _, _ = osPost.Set(originalTypeId, "typeId") _, _ = osPost.Set(originalOses, "operatingSystems") - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPost.String()).Post("/posture-checks") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPost.String()).Post("/posture-checks") ctx.Req.NoError(err) ctx.Req.Equal(http.StatusCreated, resp.StatusCode()) @@ -70,7 +70,7 @@ func Test_PostureChecks_Os(t *testing.T) { t.Run("can get", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -111,14 +111,14 @@ func Test_PostureChecks_Os(t *testing.T) { _, _ = osPatch.Set(newOses, "operatingSystems") _, _ = osPatch.Set(originalTypeId, "typeId") - patchResp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPatch.String()).Patch("/posture-checks/" + postureCheckId) + patchResp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPatch.String()).Patch("/posture-checks/" + postureCheckId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, patchResp.StatusCode()) t.Run("get after os patch has proper values", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -157,14 +157,14 @@ func Test_PostureChecks_Os(t *testing.T) { _, _ = osPatch.Set(newTags, "tags") _, _ = osPatch.Set(originalTypeId, "typeId") - patchResp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPatch.String()).Patch("/posture-checks/" + postureCheckId) + patchResp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPatch.String()).Patch("/posture-checks/" + postureCheckId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, patchResp.StatusCode()) t.Run("get after tags patch has proper values", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().SetBody(osPost.String()).Get("/posture-checks/" + postureCheckId) ctx.Req.NoError(err) ctx.Req.Equal(http.StatusOK, resp.StatusCode()) @@ -194,7 +194,7 @@ func Test_PostureChecks_Os(t *testing.T) { t.Run("can delete", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.deleteEntityOfType("posture-checks", postureCheckId) + ctx.AdminManagementSession.deleteEntityOfType("posture-checks", postureCheckId) }) }) diff --git a/tests/posture_check_process_multi_test.go b/tests/posture_check_process_multi_test.go index f9184e3d1..4349b9a72 100644 --- a/tests/posture_check_process_multi_test.go +++ b/tests/posture_check_process_multi_test.go @@ -30,7 +30,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() hashes := []string{ @@ -54,6 +54,8 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { "753DBE7F20E91437C33E89E2950BE47F3D0CE8C9", } + osTypeWindows := rest_model.OsTypeWindows + //Has hashes, has signers process01Path := `\path\to\some\binary01` process01 := &rest_model.ProcessMulti{ @@ -61,7 +63,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { hashes[0], hashes[1], }, - OsType: rest_model.OsTypeWindows, + OsType: &osTypeWindows, Path: &process01Path, SignerFingerprints: []string{ signerFingerprints[0], @@ -73,7 +75,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { process02Path := `\path\to\some\binary02` process02 := &rest_model.ProcessMulti{ Hashes: []string{}, - OsType: rest_model.OsTypeWindows, + OsType: &osTypeWindows, Path: &process02Path, SignerFingerprints: []string{ signerFingerprints[2], @@ -88,7 +90,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { hashes[4], hashes[5], }, - OsType: rest_model.OsTypeWindows, + OsType: &osTypeWindows, Path: &process03Path, SignerFingerprints: []string{}, } @@ -97,7 +99,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { process04Path := `\path\to\some\binary04` process04 := &rest_model.ProcessMulti{ Hashes: []string{}, - OsType: rest_model.OsTypeWindows, + OsType: &osTypeWindows, Path: &process04Path, SignerFingerprints: []string{}, } @@ -109,24 +111,24 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) processes := []*rest_model.ProcessMulti{ process01, } - postureCheck := ctx.AdminSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAllOf, processes, s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAllOf, processes, s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -173,12 +175,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("by submitting it", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := process01.Hashes[0] postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process01Path, + Hash: hash, + IsRunning: true, + Path: process01Path, SignerFingerprints: []string{ process01.SignerFingerprints[0], }, @@ -206,24 +208,24 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) processes := []*rest_model.ProcessMulti{ process02, } - postureCheck := ctx.AdminSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAnyOf, processes, s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAnyOf, processes, s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -270,12 +272,11 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("by submitting it", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true hash := hashes[1] //02 doesn't check hashes postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process02Path, + Hash: hash, + IsRunning: true, + Path: process02Path, SignerFingerprints: []string{ process02.SignerFingerprints[1], }, @@ -303,12 +304,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - enrolledIdentityId, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + enrolledIdentityId, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) processes := []*rest_model.ProcessMulti{ process01, @@ -317,13 +318,13 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { process04, } - processPostureCheck := ctx.AdminSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAllOf, processes, s(postureCheckRole)) + processPostureCheck := ctx.AdminManagementSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAllOf, processes, s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -373,12 +374,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 01", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := process01.Hashes[0] postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process01Path, + Hash: hash, + IsRunning: true, + Path: process01Path, SignerFingerprints: []string{ process01.SignerFingerprints[1], }, @@ -400,12 +401,11 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 02", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true hash := hashes[3] //no hashes on 02's check shouldn't matter postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process02Path, + Hash: hash, + IsRunning: true, + Path: process02Path, SignerFingerprints: []string{ process02.SignerFingerprints[0], }, @@ -427,12 +427,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 03", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := process03.Hashes[1] postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process03Path, + Hash: hash, + IsRunning: true, + Path: process03Path, SignerFingerprints: []string{ signerFingerprints[3], //no signers on 03's check shoudln't matter }, @@ -455,12 +455,11 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 04", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true hash := hashes[5] //no hashes on 04's check shouldn't matter postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process04Path, + Hash: hash, + IsRunning: true, + Path: process04Path, SignerFingerprints: []string{ signerFingerprints[2], //no signers on 04's check shouldn't matter }, @@ -485,12 +484,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 03 not running", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := false + hash := process03.Hashes[1] postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process03Path, + Hash: hash, + IsRunning: false, + Path: process03Path, SignerFingerprints: []string{ signerFingerprints[3], //no signers on 03's check shouldn't matter }, @@ -513,7 +512,7 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { }) }) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/identities/" + enrolledIdentityId + "/failed-service-requests") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/identities/" + enrolledIdentityId + "/failed-service-requests") ctx.Req.NoError(err) ctx.Req.NotNil(resp) }) @@ -525,12 +524,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - _, enrolledIdentityAuthenticator := ctx.AdminSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) - enrolledIdentitySession, err := enrolledIdentityAuthenticator.Authenticate(ctx) + _, enrolledIdentityAuthenticator := ctx.AdminManagementSession.requireCreateIdentityOttEnrollment(eid.New(), false, identityRole) + enrolledIdentitySession, err := enrolledIdentityAuthenticator.AuthenticateClientApi(ctx) ctx.Req.NoError(err) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) processes := []*rest_model.ProcessMulti{ process01, @@ -539,13 +538,13 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { process04, } - processPostureCheck := ctx.AdminSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAnyOf, processes, s(postureCheckRole)) + processPostureCheck := ctx.AdminManagementSession.requireNewPostureCheckProcessMulti(rest_model.SemanticAnyOf, processes, s(postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#"+identityRole)) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#"+serviceRole)) ctx.Req.NoError(err) @@ -595,12 +594,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 01", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := "aaaaaaaaaaaaaaaaaaaa" postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process01Path, + Hash: hash, + IsRunning: true, + Path: process01Path, SignerFingerprints: []string{ "aaaaaaaaaaaaaaaaaaaaaa", }, @@ -614,12 +613,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 02", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := hashes[3] //no hashes on 02's check shouldn't matter postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process02Path, + Hash: hash, + IsRunning: true, + Path: process02Path, SignerFingerprints: []string{ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", }, @@ -633,12 +632,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 03", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := "aaaaaaaaaaaa" postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process03Path, + Hash: hash, + IsRunning: true, + Path: process03Path, SignerFingerprints: []string{ signerFingerprints[3], //no signers on 03's check shoudln't matter }, @@ -652,12 +651,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 04", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := false + hash := hashes[5] //no hashes on 04's check shouldn't matter postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process04Path, + Hash: hash, + IsRunning: false, + Path: process04Path, SignerFingerprints: []string{ signerFingerprints[2], //no signers on 04's check shouldn't matter }, @@ -683,12 +682,12 @@ func Test_PostureChecks_ProcessMulti(t *testing.T) { t.Run("posture 04", func(t *testing.T) { ctx.testContextChanged(t) - isRunning := true + hash := hashes[5] //no hashes on 04's check shouldn't matter postureResponse := &rest_model.PostureResponseProcessCreate{ - Hash: &hash, - IsRunning: &isRunning, - Path: &process04Path, + Hash: hash, + IsRunning: true, + Path: process04Path, SignerFingerprints: []string{ signerFingerprints[2], //no signers on 04's check shouldn't matter }, diff --git a/tests/posture_check_session_test.go b/tests/posture_check_session_test.go index aae755728..cfc4e8f59 100644 --- a/tests/posture_check_session_test.go +++ b/tests/posture_check_session_test.go @@ -30,7 +30,7 @@ func Test_PostureChecks_Sessions(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() dialIdentityRole := eid.New() hostIdentityRole := eid.New() @@ -38,20 +38,20 @@ func Test_PostureChecks_Sessions(t *testing.T) { postureCheckRole := eid.New() dialDomain := "dial.example.com" - _ = ctx.AdminSession.requireNewPostureCheckDomain(s(dialDomain), s(postureCheckRole)) + _ = ctx.AdminManagementSession.requireNewPostureCheckDomain(s(dialDomain), s(postureCheckRole)) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) - service := ctx.AdminSession.testContext.newService(s(serviceRole), nil) + service := ctx.AdminManagementSession.testContext.newService(s(serviceRole), nil) service.terminatorStrategy = xt_smartrouting.Name - ctx.AdminSession.requireCreateEntity(service) + ctx.AdminManagementSession.requireCreateEntity(service) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+dialIdentityRole), s("#"+postureCheckRole)) - ctx.AdminSession.requireNewServicePolicyWithSemantic("Bind", "AllOf", s("#"+serviceRole), s("#"+hostIdentityRole), nil) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole), s("#"+dialIdentityRole), s("#"+postureCheckRole)) + ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Bind", "AllOf", s("#"+serviceRole), s("#"+hostIdentityRole), nil) ctx.CreateEnrollAndStartEdgeRouter() - _, hostContext := ctx.AdminSession.RequireCreateSdkContext(hostIdentityRole) + _, hostContext := ctx.AdminManagementSession.RequireCreateSdkContext(hostIdentityRole) defer hostContext.Close() listener, err := hostContext.Listen(service.Name) @@ -83,7 +83,7 @@ func Test_PostureChecks_Sessions(t *testing.T) { t.Run("can be created", func(t *testing.T) { ctx.testContextChanged(t) - _, ztx := ctx.AdminSession.RequireCreateSdkContext(dialIdentityRole) + _, ztx := ctx.AdminManagementSession.RequireCreateSdkContext(dialIdentityRole) clientContext = &ziti.ContextImplTest{ Context: ztx, } @@ -121,7 +121,7 @@ func Test_PostureChecks_Sessions(t *testing.T) { ctx.testContextChanged(t) currentPostureDomain = "invalid" - postureCache.SendPostureData() + postureCache.Evaluate() lastReadCount := 0 var lastReadErr error diff --git a/tests/router_identities_test.go b/tests/router_identities_test.go index eae7d4ad3..a80eda9ed 100644 --- a/tests/router_identities_test.go +++ b/tests/router_identities_test.go @@ -29,39 +29,39 @@ func TestEdgeRouterIdentities(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - edgeRouter1 := ctx.AdminSession.requireNewTunnelerEnabledEdgeRouter() + edgeRouter1 := ctx.AdminManagementSession.requireNewTunnelerEnabledEdgeRouter() // identity should have been created - identities := ctx.AdminSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) + identities := ctx.AdminManagementSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) ctx.Req.Equal(1, len(identities)) identity1 := identities[0] ctx.Req.Equal(edgeRouter1.name, identity1.name) - resp := ctx.AdminSession.deleteEntityOfType("identities", identity1.Id) + resp := ctx.AdminManagementSession.deleteEntityOfType("identities", identity1.Id) ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) identity1.name = edgeRouter1.name identity1.roleAttributes = []string{"test", "hello"} - ctx.AdminSession.requireUpdateEntity(identity1) - ctx.AdminSession.validateEntityWithLookup(identity1) + ctx.AdminManagementSession.requireUpdateEntity(identity1) + ctx.AdminManagementSession.validateEntityWithLookup(identity1) identity1.name = edgeRouter1.name identity1.roleAttributes = []string{"foo", "bar"} - ctx.AdminSession.requirePatchEntity(identity1, "roleAttributes") - ctx.AdminSession.validateEntityWithLookup(identity1) + ctx.AdminManagementSession.requirePatchEntity(identity1, "roleAttributes") + ctx.AdminManagementSession.validateEntityWithLookup(identity1) identity1.name = uuid.NewString() - resp = ctx.AdminSession.patchEntity(identity1, "name") + resp = ctx.AdminManagementSession.patchEntity(identity1, "name") ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) // should not be allowed to change name - resp = ctx.AdminSession.updateEntity(identity1) + resp = ctx.AdminManagementSession.updateEntity(identity1) ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) // should not be allowed to change name // edge router policy should have been created - edgeRouterPolicies := ctx.AdminSession.listEdgeRouterPolicies("") + edgeRouterPolicies := ctx.AdminManagementSession.listEdgeRouterPolicies("") ctx.Req.Equal(1, len(edgeRouterPolicies)) edgeRouterPolicy1 := edgeRouterPolicies[0] @@ -71,62 +71,62 @@ func TestEdgeRouterIdentities(t *testing.T) { ctx.Req.Equal(1, len(edgeRouterPolicy1.identityRoles)) ctx.Req.Equal("@"+identity1.Id, edgeRouterPolicy1.identityRoles[0]) - resp = ctx.AdminSession.deleteEntityOfType("edge-router-policies", edgeRouterPolicy1.id) + resp = ctx.AdminManagementSession.deleteEntityOfType("edge-router-policies", edgeRouterPolicy1.id) ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) // deleting edge router should remove all three entitie - ctx.AdminSession.requireDeleteEntity(edgeRouter1) - ctx.RequireNotFoundError(ctx.AdminSession.query("edge-routers/" + edgeRouter1.id)) - ctx.RequireNotFoundError(ctx.AdminSession.query("identities/" + identity1.Id)) - ctx.RequireNotFoundError(ctx.AdminSession.query("edge-router-policies/" + edgeRouterPolicy1.id)) + ctx.AdminManagementSession.requireDeleteEntity(edgeRouter1) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("edge-routers/" + edgeRouter1.id)) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("identities/" + identity1.Id)) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("edge-router-policies/" + edgeRouterPolicy1.id)) } func TestEdgeRouterIdentitiesNotEnabled(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - edgeRouter1 := ctx.AdminSession.requireNewEdgeRouter() + edgeRouter1 := ctx.AdminManagementSession.requireNewEdgeRouter() - identities := ctx.AdminSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) + identities := ctx.AdminManagementSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) ctx.Req.Equal(0, len(identities)) - edgeRouterPolicies := ctx.AdminSession.listEdgeRouterPolicies("") + edgeRouterPolicies := ctx.AdminManagementSession.listEdgeRouterPolicies("") ctx.Req.Equal(0, len(edgeRouterPolicies)) edgeRouter1.isTunnelerEnabled = true - ctx.AdminSession.requireUpdateEntity(edgeRouter1) + ctx.AdminManagementSession.requireUpdateEntity(edgeRouter1) // identity should have been created - identities = ctx.AdminSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) + identities = ctx.AdminManagementSession.listIdentities("filter=" + url.QueryEscape(`type="Router"`)) ctx.Req.Equal(1, len(identities)) identity1 := identities[0] ctx.Req.Equal(edgeRouter1.name, identity1.name) - resp := ctx.AdminSession.deleteEntityOfType("identities", identity1.Id) + resp := ctx.AdminManagementSession.deleteEntityOfType("identities", identity1.Id) ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) identity1.name = edgeRouter1.name identity1.roleAttributes = []string{"test", "hello"} - ctx.AdminSession.requireUpdateEntity(identity1) - ctx.AdminSession.validateEntityWithLookup(identity1) + ctx.AdminManagementSession.requireUpdateEntity(identity1) + ctx.AdminManagementSession.validateEntityWithLookup(identity1) identity1.name = edgeRouter1.name identity1.roleAttributes = []string{"foo", "bar"} - ctx.AdminSession.requirePatchEntity(identity1, "roleAttributes") - ctx.AdminSession.validateEntityWithLookup(identity1) + ctx.AdminManagementSession.requirePatchEntity(identity1, "roleAttributes") + ctx.AdminManagementSession.validateEntityWithLookup(identity1) identity1.name = uuid.NewString() - resp = ctx.AdminSession.patchEntity(identity1, "name") + resp = ctx.AdminManagementSession.patchEntity(identity1, "name") ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) // should not be allowed to change name - resp = ctx.AdminSession.updateEntity(identity1) + resp = ctx.AdminManagementSession.updateEntity(identity1) ctx.Req.Equal(http.StatusBadRequest, resp.StatusCode()) // should not be allowed to change name // edge router policy should have been created - edgeRouterPolicies = ctx.AdminSession.listEdgeRouterPolicies("") + edgeRouterPolicies = ctx.AdminManagementSession.listEdgeRouterPolicies("") ctx.Req.Equal(1, len(edgeRouterPolicies)) edgeRouterPolicy1 := edgeRouterPolicies[0] @@ -137,9 +137,9 @@ func TestEdgeRouterIdentitiesNotEnabled(t *testing.T) { ctx.Req.Equal("@"+identity1.Id, edgeRouterPolicy1.identityRoles[0]) edgeRouter1.isTunnelerEnabled = false - ctx.AdminSession.requireUpdateEntity(edgeRouter1) + ctx.AdminManagementSession.requireUpdateEntity(edgeRouter1) // setting flag to false should remove associated entities - ctx.RequireNotFoundError(ctx.AdminSession.query("identities/" + identity1.Id)) - ctx.RequireNotFoundError(ctx.AdminSession.query("edge-router-policies/" + edgeRouterPolicy1.id)) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("identities/" + identity1.Id)) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("edge-router-policies/" + edgeRouterPolicy1.id)) } diff --git a/tests/service_edge_router_policy_test.go b/tests/service_edge_router_policy_test.go index b3b9a11b0..160495495 100644 --- a/tests/service_edge_router_policy_test.go +++ b/tests/service_edge_router_policy_test.go @@ -28,49 +28,49 @@ func Test_ServiceEdgeRouterPolicy(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() edgeRouterRole1 := eid.New() edgeRouterRole2 := eid.New() serviceRole1 := eid.New() serviceRole2 := eid.New() - edgeRouter1 := ctx.AdminSession.requireNewEdgeRouter(edgeRouterRole1) - edgeRouter2 := ctx.AdminSession.requireNewEdgeRouter(edgeRouterRole1, edgeRouterRole2) - edgeRouter3 := ctx.AdminSession.requireNewEdgeRouter() + edgeRouter1 := ctx.AdminManagementSession.requireNewEdgeRouter(edgeRouterRole1) + edgeRouter2 := ctx.AdminManagementSession.requireNewEdgeRouter(edgeRouterRole1, edgeRouterRole2) + edgeRouter3 := ctx.AdminManagementSession.requireNewEdgeRouter() - service1 := ctx.AdminSession.requireNewService(s(serviceRole1), nil) - service2 := ctx.AdminSession.requireNewService(s(serviceRole1, serviceRole2), nil) - service3 := ctx.AdminSession.requireNewService(s(serviceRole2), nil) + service1 := ctx.AdminManagementSession.requireNewService(s(serviceRole1), nil) + service2 := ctx.AdminManagementSession.requireNewService(s(serviceRole1, serviceRole2), nil) + service3 := ctx.AdminManagementSession.requireNewService(s(serviceRole2), nil) - policy1 := ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#"+edgeRouterRole1), s("#"+serviceRole1)) - policy2 := ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#"+edgeRouterRole1, "@"+edgeRouter3.id), s("#"+serviceRole1, "@"+service3.Id)) - policy3 := ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("@"+edgeRouter2.id, "@"+edgeRouter3.id), s("@"+service2.Id, "@"+service3.Id)) - policy4 := ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) - policy5 := ctx.AdminSession.requireNewServiceEdgeRouterPolicyWithSemantic("AllOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+serviceRole1, "#"+serviceRole2)) - policy6 := ctx.AdminSession.requireNewServiceEdgeRouterPolicyWithSemantic("AnyOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+serviceRole1, "#"+serviceRole2)) + policy1 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#"+edgeRouterRole1), s("#"+serviceRole1)) + policy2 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#"+edgeRouterRole1, "@"+edgeRouter3.id), s("#"+serviceRole1, "@"+service3.Id)) + policy3 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("@"+edgeRouter2.id, "@"+edgeRouter3.id), s("@"+service2.Id, "@"+service3.Id)) + policy4 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) + policy5 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicyWithSemantic("AllOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+serviceRole1, "#"+serviceRole2)) + policy6 := ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicyWithSemantic("AnyOf", s("#"+edgeRouterRole1, "#"+edgeRouterRole2), s("#"+serviceRole1, "#"+serviceRole2)) - ctx.AdminSession.validateEntityWithQuery(policy1) - ctx.AdminSession.validateEntityWithLookup(policy2) - ctx.AdminSession.validateEntityWithLookup(policy3) - ctx.AdminSession.validateEntityWithLookup(policy4) - ctx.AdminSession.validateEntityWithLookup(policy5) - ctx.AdminSession.validateEntityWithLookup(policy6) + ctx.AdminManagementSession.validateEntityWithQuery(policy1) + ctx.AdminManagementSession.validateEntityWithLookup(policy2) + ctx.AdminManagementSession.validateEntityWithLookup(policy3) + ctx.AdminManagementSession.validateEntityWithLookup(policy4) + ctx.AdminManagementSession.validateEntityWithLookup(policy5) + ctx.AdminManagementSession.validateEntityWithLookup(policy6) - ctx.AdminSession.validateAssociations(policy1, "edge-routers", edgeRouter1, edgeRouter2) - ctx.AdminSession.validateAssociations(policy2, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) - ctx.AdminSession.validateAssociations(policy3, "edge-routers", edgeRouter2, edgeRouter3) - ctx.AdminSession.validateAssociationContains(policy4, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) - ctx.AdminSession.validateAssociations(policy5, "edge-routers", edgeRouter2) - ctx.AdminSession.validateAssociations(policy6, "edge-routers", edgeRouter1, edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy1, "edge-routers", edgeRouter1, edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy2, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociations(policy3, "edge-routers", edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "edge-routers", edgeRouter1, edgeRouter2, edgeRouter3) + ctx.AdminManagementSession.validateAssociations(policy5, "edge-routers", edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy6, "edge-routers", edgeRouter1, edgeRouter2) - ctx.AdminSession.validateAssociations(policy1, "services", service1, service2) - ctx.AdminSession.validateAssociations(policy2, "services", service1, service2, service3) + ctx.AdminManagementSession.validateAssociations(policy1, "services", service1, service2) + ctx.AdminManagementSession.validateAssociations(policy2, "services", service1, service2, service3) t.Run("policy 2 has display information", func(t *testing.T) { ctx.testContextChanged(t) url := fmt.Sprintf("%v/%v", policy2.getEntityType(), policy2.getId()) - result := ctx.AdminSession.requireQuery(url) + result := ctx.AdminManagementSession.requireQuery(url) t.Run("for service 3 and service role 1", func(t *testing.T) { ctx.testContextChanged(t) @@ -133,41 +133,41 @@ func Test_ServiceEdgeRouterPolicy(t *testing.T) { }) }) - ctx.AdminSession.validateAssociations(policy3, "services", service2, service3) - ctx.AdminSession.validateAssociationContains(policy4, "services", service1, service2, service3) - ctx.AdminSession.validateAssociations(policy5, "services", service2) - ctx.AdminSession.validateAssociations(policy6, "services", service1, service2, service3) + ctx.AdminManagementSession.validateAssociations(policy3, "services", service2, service3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "services", service1, service2, service3) + ctx.AdminManagementSession.validateAssociations(policy5, "services", service2) + ctx.AdminManagementSession.validateAssociations(policy6, "services", service1, service2, service3) - ctx.AdminSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy1, policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy2, policy3, policy4) - ctx.AdminSession.validateAssociations(service1, "service-edge-router-policies", policy1, policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-edge-router-policies", policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service1, "service-edge-router-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service3, "service-edge-router-policies", policy2, policy3, policy4, policy6) policy1.edgeRouterRoles = append(policy1.edgeRouterRoles, "#"+edgeRouterRole2) policy1.serviceRoles = s("#" + serviceRole2) - ctx.AdminSession.requireUpdateEntity(policy1) + ctx.AdminManagementSession.requireUpdateEntity(policy1) - ctx.AdminSession.validateAssociations(policy1, "edge-routers", edgeRouter2) - ctx.AdminSession.validateAssociations(policy1, "services", service2, service3) + ctx.AdminManagementSession.validateAssociations(policy1, "edge-routers", edgeRouter2) + ctx.AdminManagementSession.validateAssociations(policy1, "services", service2, service3) - ctx.AdminSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy2, policy3, policy4) - ctx.AdminSession.validateAssociations(service1, "service-edge-router-policies", policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service1, "service-edge-router-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service3, "service-edge-router-policies", policy1, policy2, policy3, policy4, policy6) - ctx.AdminSession.requireDeleteEntity(policy2) + ctx.AdminManagementSession.requireDeleteEntity(policy2) - ctx.AdminSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy4, policy6) - ctx.AdminSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy3, policy4) + ctx.AdminManagementSession.validateAssociations(edgeRouter1, "service-edge-router-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter2, "service-edge-router-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(edgeRouter3, "service-edge-router-policies", policy3, policy4) - ctx.AdminSession.validateAssociations(service1, "service-edge-router-policies", policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-edge-router-policies", policy1, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service1, "service-edge-router-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-edge-router-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service3, "service-edge-router-policies", policy1, policy3, policy4, policy6) } diff --git a/tests/service_list_refresh_test.go b/tests/service_list_refresh_test.go index 13c273044..50a8e27dd 100644 --- a/tests/service_list_refresh_test.go +++ b/tests/service_list_refresh_test.go @@ -10,8 +10,8 @@ import ( func setupServiceListRefreshTest(ctx *TestContext) (string, *identity, *session) { identityRole := eid.New() - identity, userAuth := ctx.AdminSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), "1s2w3e4r5t6", false, identityRole) - nonAdminUserSession, err := userAuth.Authenticate(ctx) + identity, userAuth := ctx.AdminManagementSession.requireCreateIdentityWithUpdbEnrollment(eid.New(), "1s2w3e4r5t6", false, identityRole) + nonAdminUserSession, err := userAuth.AuthenticateClientApi(ctx) ctx.Req.NoError(err) lastUpdate := nonAdminUserSession.getServiceUpdateTime() @@ -26,7 +26,7 @@ func Test_ServiceListRefresh(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("test matched new policy", func(t *testing.T) { ctx.testContextChanged(t) @@ -34,11 +34,11 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -48,15 +48,15 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() - ctx.AdminSession.requireDeleteEntity(policy) + ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -65,16 +65,16 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s(), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s(), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeUnchanged() policy.identityRoles = s("#" + identityRole) - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -83,17 +83,17 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() policy.identityRoles = s() - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -102,16 +102,16 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s(), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s(), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeUnchanged() policy.serviceRoles = s("#" + serviceRole) - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -120,17 +120,17 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() policy.serviceRoles = s() - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -140,16 +140,16 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() identityRole2 := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole2), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole2), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeUnchanged() identity.roleAttributes = s(identityRole, identityRole2) - ctx.AdminSession.requireUpdateEntity(identity) + ctx.AdminManagementSession.requireUpdateEntity(identity) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -161,18 +161,18 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole2 := eid.New() identity.roleAttributes = s(identityRole, identityRole2) - ctx.AdminSession.requireUpdateEntity(identity) + ctx.AdminManagementSession.requireUpdateEntity(identity) nonAdminUserSession.requireServiceUpdateTimeUnchanged() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole2), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole2), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) time.Sleep(time.Millisecond) identity.roleAttributes = s(identityRole) - ctx.AdminSession.requireUpdateEntity(identity) + ctx.AdminManagementSession.requireUpdateEntity(identity) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -182,13 +182,13 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeUnchanged() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -198,15 +198,15 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeUnchanged() service.roleAttributes = s(serviceRole) - ctx.AdminSession.requireUpdateEntity(service) + ctx.AdminManagementSession.requireUpdateEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -216,18 +216,18 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) time.Sleep(time.Millisecond) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() service.roleAttributes = nil - ctx.AdminSession.requireUpdateEntity(service) + ctx.AdminManagementSession.requireUpdateEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -236,15 +236,15 @@ func Test_ServiceListRefresh(t *testing.T) { identityRole, _, nonAdminUserSession := setupServiceListRefreshTest(ctx) serviceRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() - ctx.AdminSession.requireDeleteEntity(service) + ctx.AdminManagementSession.requireDeleteEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -254,28 +254,28 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) - configType := ctx.AdminSession.requireCreateNewConfigType() - defer ctx.AdminSession.requireDeleteEntity(configType) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + defer ctx.AdminManagementSession.requireDeleteEntity(configType) config := ctx.newConfig(configType.Id, map[string]interface{}{"name": "Alpha"}) - ctx.AdminSession.requireCreateEntity(config) + ctx.AdminManagementSession.requireCreateEntity(config) - service := ctx.AdminSession.requireNewService(s(serviceRole), s(config.Id)) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), s(config.Id)) + defer ctx.AdminManagementSession.requireDeleteEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() time.Sleep(time.Millisecond) config.Data = map[string]interface{}{"name": "Beta"} - ctx.AdminSession.requireUpdateEntity(config) + ctx.AdminManagementSession.requireUpdateEntity(config) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() - ctx.AdminSession.requireDeleteEntity(config) + ctx.AdminManagementSession.requireDeleteEntity(config) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -285,23 +285,23 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) - configType := ctx.AdminSession.requireCreateNewConfigType() - defer ctx.AdminSession.requireDeleteEntity(configType) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + defer ctx.AdminManagementSession.requireDeleteEntity(configType) config := ctx.newConfig(configType.Id, map[string]interface{}{"name": "Alpha"}) - ctx.AdminSession.requireCreateEntity(config) + ctx.AdminManagementSession.requireCreateEntity(config) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() time.Sleep(time.Millisecond) - ctx.AdminSession.requireAssignIdentityServiceConfigs(identity.Id, serviceConfig{ + ctx.AdminManagementSession.requireAssignIdentityServiceConfigs(identity.Id, serviceConfig{ ServiceId: service.Id, ConfigId: config.Id, }) @@ -310,12 +310,12 @@ func Test_ServiceListRefresh(t *testing.T) { time.Sleep(time.Millisecond) config.Data = map[string]interface{}{"name": "Beta"} - ctx.AdminSession.requireUpdateEntity(config) + ctx.AdminManagementSession.requireUpdateEntity(config) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() - ctx.AdminSession.requireDeleteEntity(config) + ctx.AdminManagementSession.requireDeleteEntity(config) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -325,30 +325,30 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) - configType := ctx.AdminSession.requireCreateNewConfigType() - defer ctx.AdminSession.requireDeleteEntity(configType) + configType := ctx.AdminManagementSession.requireCreateNewConfigType() + defer ctx.AdminManagementSession.requireDeleteEntity(configType) config := ctx.newConfig(configType.Id, map[string]interface{}{"name": "Alpha"}) - ctx.AdminSession.requireCreateEntity(config) - defer ctx.AdminSession.requireDeleteEntity(config) + ctx.AdminManagementSession.requireCreateEntity(config) + defer ctx.AdminManagementSession.requireDeleteEntity(config) - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) nonAdminUserSession.requireServiceUpdateTimeAdvanced() nonAdminUserSession.requireServiceUpdateTimeUnchanged() - ctx.AdminSession.requireAssignIdentityServiceConfigs(identity.Id, serviceConfig{ + ctx.AdminManagementSession.requireAssignIdentityServiceConfigs(identity.Id, serviceConfig{ ServiceId: service.Id, ConfigId: config.Id, }) nonAdminUserSession.requireServiceUpdateTimeAdvanced() - ctx.AdminSession.requireRemoveIdentityServiceConfigs(identity.Id, serviceConfig{ + ctx.AdminManagementSession.requireRemoveIdentityServiceConfigs(identity.Id, serviceConfig{ ServiceId: service.Id, ConfigId: config.Id, }) @@ -363,16 +363,16 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(postureCheck) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(postureCheck) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -384,17 +384,17 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() - ctx.AdminSession.requireDeleteEntity(postureCheck) + ctx.AdminManagementSession.requireDeleteEntity(postureCheck) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -405,19 +405,19 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(postureCheck) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(postureCheck) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() policy.postureCheckRoles = s("#" + postureCheckRole) - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -428,19 +428,19 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(postureCheck) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(postureCheck) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() policy.postureCheckRoles = s() - ctx.AdminSession.requireUpdateEntity(policy) + ctx.AdminManagementSession.requireUpdateEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -451,19 +451,19 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s()) - defer ctx.AdminSession.requireDeleteEntity(postureCheck) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s()) + defer ctx.AdminManagementSession.requireDeleteEntity(postureCheck) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() postureCheck.roleAttributes = s(postureCheckRole) - ctx.AdminSession.requireUpdateEntity(postureCheck) + ctx.AdminManagementSession.requireUpdateEntity(postureCheck) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) @@ -474,19 +474,19 @@ func Test_ServiceListRefresh(t *testing.T) { serviceRole := eid.New() postureCheckRole := eid.New() - service := ctx.AdminSession.requireNewService(s(serviceRole), nil) - defer ctx.AdminSession.requireDeleteEntity(service) + service := ctx.AdminManagementSession.requireNewService(s(serviceRole), nil) + defer ctx.AdminManagementSession.requireDeleteEntity(service) - postureCheck := ctx.AdminSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(postureCheck) + postureCheck := ctx.AdminManagementSession.requireNewPostureCheckDomain(s("domain1"), s(postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(postureCheck) - policy := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) - defer ctx.AdminSession.requireDeleteEntity(policy) + policy := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole), s("#"+identityRole), s("#"+postureCheckRole)) + defer ctx.AdminManagementSession.requireDeleteEntity(policy) nonAdminUserSession.requireServiceUpdateTimeAdvanced() postureCheck.roleAttributes = s() - ctx.AdminSession.requireUpdateEntity(postureCheck) + ctx.AdminManagementSession.requireUpdateEntity(postureCheck) nonAdminUserSession.requireServiceUpdateTimeAdvanced() }) } diff --git a/tests/service_policy_test.go b/tests/service_policy_test.go index d6f99b201..b118d25d1 100644 --- a/tests/service_policy_test.go +++ b/tests/service_policy_test.go @@ -28,42 +28,42 @@ func Test_ServicePolicy(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() serviceRole1 := eid.New() serviceRole2 := eid.New() identityRole1 := eid.New() identityRole2 := eid.New() - service1 := ctx.AdminSession.requireNewService(s(serviceRole1), nil) - service2 := ctx.AdminSession.requireNewService(s(serviceRole1, serviceRole2), nil) - service3 := ctx.AdminSession.requireNewService(nil, nil) + service1 := ctx.AdminManagementSession.requireNewService(s(serviceRole1), nil) + service2 := ctx.AdminManagementSession.requireNewService(s(serviceRole1, serviceRole2), nil) + service3 := ctx.AdminManagementSession.requireNewService(nil, nil) - identity1 := ctx.AdminSession.requireNewIdentity(false, identityRole1) - identity2 := ctx.AdminSession.requireNewIdentity(false, identityRole1, identityRole2) - identity3 := ctx.AdminSession.requireNewIdentity(false, identityRole2) + identity1 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole1) + identity2 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole1, identityRole2) + identity3 := ctx.AdminManagementSession.requireNewIdentity(false, identityRole2) - policy1 := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole1), s("#"+identityRole1), s()) - policy2 := ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+serviceRole1, "@"+service3.Id), s("#"+identityRole1, "@"+identity3.Id), s()) - policy3 := ctx.AdminSession.requireNewServicePolicy("Dial", s("@"+service2.Id, "@"+service3.Id), s("@"+identity2.Id, "@"+identity3.Id), s()) - policy4 := ctx.AdminSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) - policy5 := ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole1, "#"+serviceRole2), s("#"+identityRole1, "#"+identityRole2), s()) - policy6 := ctx.AdminSession.requireNewServicePolicyWithSemantic("Dial", "AnyOf", s("#"+serviceRole1, "#"+serviceRole2), s("#"+identityRole1, "#"+identityRole2), s()) + policy1 := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole1), s("#"+identityRole1), s()) + policy2 := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+serviceRole1, "@"+service3.Id), s("#"+identityRole1, "@"+identity3.Id), s()) + policy3 := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("@"+service2.Id, "@"+service3.Id), s("@"+identity2.Id, "@"+identity3.Id), s()) + policy4 := ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) + policy5 := ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AllOf", s("#"+serviceRole1, "#"+serviceRole2), s("#"+identityRole1, "#"+identityRole2), s()) + policy6 := ctx.AdminManagementSession.requireNewServicePolicyWithSemantic("Dial", "AnyOf", s("#"+serviceRole1, "#"+serviceRole2), s("#"+identityRole1, "#"+identityRole2), s()) - ctx.AdminSession.validateEntityWithQuery(policy1) - ctx.AdminSession.validateEntityWithLookup(policy2) - ctx.AdminSession.validateEntityWithLookup(policy3) - ctx.AdminSession.validateEntityWithLookup(policy4) - ctx.AdminSession.validateEntityWithLookup(policy5) - ctx.AdminSession.validateEntityWithLookup(policy6) + ctx.AdminManagementSession.validateEntityWithQuery(policy1) + ctx.AdminManagementSession.validateEntityWithLookup(policy2) + ctx.AdminManagementSession.validateEntityWithLookup(policy3) + ctx.AdminManagementSession.validateEntityWithLookup(policy4) + ctx.AdminManagementSession.validateEntityWithLookup(policy5) + ctx.AdminManagementSession.validateEntityWithLookup(policy6) - ctx.AdminSession.validateAssociations(policy1, "services", service1, service2) - ctx.AdminSession.validateAssociations(policy2, "services", service1, service2, service3) + ctx.AdminManagementSession.validateAssociations(policy1, "services", service1, service2) + ctx.AdminManagementSession.validateAssociations(policy2, "services", service1, service2, service3) t.Run("policy 2 has display information", func(t *testing.T) { ctx.testContextChanged(t) url := fmt.Sprintf("%v/%v", policy2.getEntityType(), policy2.getId()) - result := ctx.AdminSession.requireQuery(url) + result := ctx.AdminManagementSession.requireQuery(url) t.Run("for service 3 and service role 1", func(t *testing.T) { ctx.testContextChanged(t) @@ -126,49 +126,49 @@ func Test_ServicePolicy(t *testing.T) { }) }) - ctx.AdminSession.validateAssociations(policy3, "services", service2, service3) - ctx.AdminSession.validateAssociationContains(policy4, "services", service1, service2, service3) - ctx.AdminSession.validateAssociationContains(policy5, "services", service2) - ctx.AdminSession.validateAssociationContains(policy6, "services", service1, service2) + ctx.AdminManagementSession.validateAssociations(policy3, "services", service2, service3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "services", service1, service2, service3) + ctx.AdminManagementSession.validateAssociationContains(policy5, "services", service2) + ctx.AdminManagementSession.validateAssociationContains(policy6, "services", service1, service2) - ctx.AdminSession.validateAssociations(policy1, "identities", identity1, identity2) - ctx.AdminSession.validateAssociations(policy2, "identities", identity1, identity2, identity3) - ctx.AdminSession.validateAssociations(policy3, "identities", identity2, identity3) - ctx.AdminSession.validateAssociationContains(policy4, "identities", identity1, identity2, identity3) - ctx.AdminSession.validateAssociations(policy5, "identities", identity2) - ctx.AdminSession.validateAssociations(policy6, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy1, "identities", identity1, identity2) + ctx.AdminManagementSession.validateAssociations(policy2, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy3, "identities", identity2, identity3) + ctx.AdminManagementSession.validateAssociationContains(policy4, "identities", identity1, identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy5, "identities", identity2) + ctx.AdminManagementSession.validateAssociations(policy6, "identities", identity1, identity2, identity3) - ctx.AdminSession.validateAssociations(service1, "service-policies", policy1, policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(service1, "service-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service3, "service-policies", policy2, policy3, policy4) - ctx.AdminSession.validateAssociations(identity1, "service-policies", policy1, policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(identity2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(identity3, "service-policies", policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "service-policies", policy1, policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "service-policies", policy2, policy3, policy4, policy6) policy1.serviceRoles = append(policy1.serviceRoles, "#"+serviceRole2) policy1.identityRoles = s("#" + identityRole2) - ctx.AdminSession.requireUpdateEntity(policy1) + ctx.AdminManagementSession.requireUpdateEntity(policy1) - ctx.AdminSession.validateAssociations(policy1, "services", service2) - ctx.AdminSession.validateAssociations(policy1, "identities", identity2, identity3) + ctx.AdminManagementSession.validateAssociations(policy1, "services", service2) + ctx.AdminManagementSession.validateAssociations(policy1, "identities", identity2, identity3) - ctx.AdminSession.validateAssociations(service1, "service-policies", policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-policies", policy2, policy3, policy4) + ctx.AdminManagementSession.validateAssociations(service1, "service-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service3, "service-policies", policy2, policy3, policy4) - ctx.AdminSession.validateAssociations(identity1, "service-policies", policy2, policy4, policy6) - ctx.AdminSession.validateAssociations(identity2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(identity3, "service-policies", policy1, policy2, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "service-policies", policy2, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "service-policies", policy1, policy2, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "service-policies", policy1, policy2, policy3, policy4, policy6) - ctx.AdminSession.requireDeleteEntity(policy2) + ctx.AdminManagementSession.requireDeleteEntity(policy2) - ctx.AdminSession.validateAssociations(service1, "service-policies", policy4, policy6) - ctx.AdminSession.validateAssociations(service2, "service-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(service1, "service-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(service2, "service-policies", policy1, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(service3, "service-policies", policy3, policy4) + ctx.AdminManagementSession.validateAssociations(service3, "service-policies", policy3, policy4) - ctx.AdminSession.validateAssociations(identity1, "service-policies", policy4, policy6) - ctx.AdminSession.validateAssociations(identity2, "service-policies", policy1, policy3, policy4, policy5, policy6) - ctx.AdminSession.validateAssociations(identity3, "service-policies", policy1, policy3, policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity1, "service-policies", policy4, policy6) + ctx.AdminManagementSession.validateAssociations(identity2, "service-policies", policy1, policy3, policy4, policy5, policy6) + ctx.AdminManagementSession.validateAssociations(identity3, "service-policies", policy1, policy3, policy4, policy6) } diff --git a/tests/service_test.go b/tests/service_test.go index 530ae5cd8..84b113956 100644 --- a/tests/service_test.go +++ b/tests/service_test.go @@ -33,60 +33,60 @@ func Test_Services(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() identityRole := eid.New() - nonAdminUserSession := ctx.AdminSession.createUserAndLogin(false, s(identityRole), nil) + nonAdminUserSession := ctx.AdminManagementSession.createUserAndLoginClientApi(false, s(identityRole), nil) t.Run("create without name should fail", func(t *testing.T) { ctx.testContextChanged(t) service := ctx.newService(nil, nil) service.Name = "" - resp := ctx.AdminSession.createEntity(service) + resp := ctx.AdminManagementSession.createEntity(service) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "name") }) t.Run("create should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) service.permissions = []string{"Dial", "Bind"} - entityJson := ctx.AdminSession.validateEntityWithQuery(service) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(service) ctx.validateDateFieldsForCreate(now, entityJson) }) t.Run("list as admin should return 3 services", func(t *testing.T) { ctx.testContextChanged(t) - service1 := ctx.AdminSession.requireNewService(nil, nil) + service1 := ctx.AdminManagementSession.requireNewService(nil, nil) service1.permissions = []string{"Dial", "Bind"} - service2 := ctx.AdminSession.requireNewService(nil, nil) + service2 := ctx.AdminManagementSession.requireNewService(nil, nil) service2.permissions = []string{"Dial", "Bind"} - service3 := ctx.AdminSession.requireNewService(nil, nil) + service3 := ctx.AdminManagementSession.requireNewService(nil, nil) service3.permissions = []string{"Dial", "Bind"} - ctx.AdminSession.validateEntityWithLookup(service1) - ctx.AdminSession.validateEntityWithQuery(service1) - ctx.AdminSession.validateEntityWithQuery(service2) - ctx.AdminSession.validateEntityWithQuery(service3) + ctx.AdminManagementSession.validateEntityWithLookup(service1) + ctx.AdminManagementSession.validateEntityWithQuery(service1) + ctx.AdminManagementSession.validateEntityWithQuery(service2) + ctx.AdminManagementSession.validateEntityWithQuery(service3) }) t.Run("list as non-admin should return 3 services", func(t *testing.T) { ctx.testContextChanged(t) dialRole := eid.New() bindRole := eid.New() - service1 := ctx.AdminSession.requireNewService(s(dialRole), nil) + service1 := ctx.AdminManagementSession.requireNewService(s(dialRole), nil) service1.permissions = []string{"Dial"} - service2 := ctx.AdminSession.requireNewService(s(bindRole), nil) + service2 := ctx.AdminManagementSession.requireNewService(s(bindRole), nil) service2.permissions = []string{"Bind"} - service3 := ctx.AdminSession.requireNewService(s(dialRole, bindRole), nil) + service3 := ctx.AdminManagementSession.requireNewService(s(dialRole, bindRole), nil) service3.permissions = []string{"Dial", "Bind"} - service4 := ctx.AdminSession.requireNewService(nil, nil) - service5 := ctx.AdminSession.requireNewService(nil, nil) - service6 := ctx.AdminSession.requireNewService(nil, nil) - service7 := ctx.AdminSession.requireNewService(nil, nil) + service4 := ctx.AdminManagementSession.requireNewService(nil, nil) + service5 := ctx.AdminManagementSession.requireNewService(nil, nil) + service6 := ctx.AdminManagementSession.requireNewService(nil, nil) + service7 := ctx.AdminManagementSession.requireNewService(nil, nil) - ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+dialRole), s("#"+identityRole), s()) - ctx.AdminSession.requireNewServicePolicy("Bind", s("#"+bindRole), s("#"+identityRole), s()) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+dialRole), s("#"+identityRole), s()) + ctx.AdminManagementSession.requireNewServicePolicy("Bind", s("#"+bindRole), s("#"+identityRole), s()) query := url.QueryEscape(fmt.Sprintf(`id in ["%v", "%v", "%v", "%v", "%v", "%v", "%v"]`, service1.Id, service2.Id, service3.Id, service4.Id, service5.Id, service6.Id, service7.Id)) @@ -107,29 +107,29 @@ func Test_Services(t *testing.T) { t.Run("lookup as admin should pass", func(t *testing.T) { ctx.testContextChanged(t) - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) service.permissions = []string{"Dial", "Bind"} - ctx.AdminSession.validateEntityWithLookup(service) + ctx.AdminManagementSession.validateEntityWithLookup(service) }) t.Run("lookup non-existent service as admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - ctx.RequireNotFoundError(ctx.AdminSession.query("services/" + eid.New())) + ctx.RequireNotFoundError(ctx.AdminManagementSession.query("services/" + eid.New())) }) t.Run("lookup existing service as non-admin should pass", func(t *testing.T) { ctx.testContextChanged(t) dialRole := eid.New() bindRole := eid.New() - service1 := ctx.AdminSession.requireNewService(s(dialRole), nil) + service1 := ctx.AdminManagementSession.requireNewService(s(dialRole), nil) service1.permissions = []string{"Dial"} - service2 := ctx.AdminSession.requireNewService(s(bindRole), nil) + service2 := ctx.AdminManagementSession.requireNewService(s(bindRole), nil) service2.permissions = []string{"Bind"} - service3 := ctx.AdminSession.requireNewService(s(dialRole, bindRole), nil) + service3 := ctx.AdminManagementSession.requireNewService(s(dialRole, bindRole), nil) service3.permissions = []string{"Dial", "Bind"} - ctx.AdminSession.requireNewServicePolicy("Dial", s("#"+dialRole), s("#"+identityRole), s()) - ctx.AdminSession.requireNewServicePolicy("Bind", s("#"+bindRole), s("#"+identityRole), s()) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#"+dialRole), s("#"+identityRole), s()) + ctx.AdminManagementSession.requireNewServicePolicy("Bind", s("#"+bindRole), s("#"+identityRole), s()) nonAdminUserSession.validateEntityWithLookup(service1) nonAdminUserSession.validateEntityWithLookup(service2) @@ -143,7 +143,7 @@ func Test_Services(t *testing.T) { t.Run("query non-visible service as non-admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) query := url.QueryEscape(fmt.Sprintf(`id in ["%v"]`, service.Id)) body := nonAdminUserSession.requireQuery("services?filter=" + query) data := body.S("data") @@ -153,7 +153,7 @@ func Test_Services(t *testing.T) { t.Run("lookup non-visible service as non-admin should fail", func(t *testing.T) { ctx.testContextChanged(t) - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) httpStatus, body := nonAdminUserSession.query("services/" + service.Id) ctx.logJson(body) ctx.RequireNotFoundError(httpStatus, body) @@ -162,17 +162,17 @@ func Test_Services(t *testing.T) { t.Run("update service should pass", func(t *testing.T) { ctx.testContextChanged(t) now := time.Now() - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) service.permissions = []string{"Bind", "Dial"} - entityJson := ctx.AdminSession.validateEntityWithQuery(service) + entityJson := ctx.AdminManagementSession.validateEntityWithQuery(service) createdAt := ctx.validateDateFieldsForCreate(now, entityJson) time.Sleep(time.Millisecond * 100) now = time.Now() service.terminatorStrategy = "ha" - ctx.AdminSession.requireUpdateEntity(service) + ctx.AdminManagementSession.requireUpdateEntity(service) - result := ctx.AdminSession.requireQuery("services/" + service.Id) + result := ctx.AdminManagementSession.requireQuery("services/" + service.Id) jsonService := ctx.RequireGetNonNilPathValue(result, "data") service.validate(ctx, jsonService) ctx.validateDateFieldsForUpdate(now, createdAt, jsonService) @@ -183,40 +183,40 @@ func Test_ServiceListWithConfigs(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - configType1 := ctx.AdminSession.requireCreateNewConfigTypeWithPrefix("ONE") - configType2 := ctx.AdminSession.requireCreateNewConfigTypeWithPrefix("TWO") - configType3 := ctx.AdminSession.requireCreateNewConfigTypeWithPrefix("THREE") + configType1 := ctx.AdminManagementSession.requireCreateNewConfigTypeWithPrefix("ONE") + configType2 := ctx.AdminManagementSession.requireCreateNewConfigTypeWithPrefix("TWO") + configType3 := ctx.AdminManagementSession.requireCreateNewConfigTypeWithPrefix("THREE") - config1 := ctx.AdminSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ + config1 := ctx.AdminManagementSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ "hostname": "foo", "port": float64(22), }) - config2 := ctx.AdminSession.requireCreateNewConfig(configType2.Id, map[string]interface{}{ + config2 := ctx.AdminManagementSession.requireCreateNewConfig(configType2.Id, map[string]interface{}{ "dialAddress": "tcp:localhost:5432", }) - config3 := ctx.AdminSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ + config3 := ctx.AdminManagementSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ "hostname": "bar", "port": float64(80), }) - config4 := ctx.AdminSession.requireCreateNewConfig(configType2.Id, map[string]interface{}{ + config4 := ctx.AdminManagementSession.requireCreateNewConfig(configType2.Id, map[string]interface{}{ "dialAddress": "udp:external:5432", }) - config5 := ctx.AdminSession.requireCreateNewConfig(configType3.Id, map[string]interface{}{ + config5 := ctx.AdminManagementSession.requireCreateNewConfig(configType3.Id, map[string]interface{}{ "froboz": "schnapplecakes", }) - service1 := ctx.AdminSession.requireNewService(nil, nil) - service2 := ctx.AdminSession.requireNewService(nil, s(config1.Id)) - service3 := ctx.AdminSession.requireNewService(nil, s(config2.Id)) - service4 := ctx.AdminSession.requireNewService(nil, s(config2.Id, config3.Id)) + service1 := ctx.AdminManagementSession.requireNewService(nil, nil) + service2 := ctx.AdminManagementSession.requireNewService(nil, s(config1.Id)) + service3 := ctx.AdminManagementSession.requireNewService(nil, s(config2.Id)) + service4 := ctx.AdminManagementSession.requireNewService(nil, s(config2.Id, config3.Id)) - ctx.AdminSession.validateAssociations(service4, "configs", config2, config3) + ctx.AdminManagementSession.validateAssociations(service4, "configs", config2, config3) service1V := &configValidatingService{service: service1} service2V := &configValidatingService{service: service2} @@ -225,15 +225,15 @@ func Test_ServiceListWithConfigs(t *testing.T) { services := []*configValidatingService{service1V, service2V, service3V, service4V} - ctx.AdminSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), s()) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), s()) - session := ctx.AdminSession.createUserAndLogin(false, nil, nil) + session := ctx.AdminManagementSession.createUserAndLoginClientApi(false, nil, nil) for _, service := range services { service.configs = map[string]*Config{} session.validateEntityWithQuery(service) } - session = ctx.AdminSession.createUserAndLogin(false, nil, s(configType1.Id)) + session = ctx.AdminManagementSession.createUserAndLoginClientApi(false, nil, s(configType1.Id)) service2V.configs[configType1.Name] = config1 service4V.configs[configType1.Name] = config3 for _, service := range services { @@ -241,14 +241,14 @@ func Test_ServiceListWithConfigs(t *testing.T) { service.configs = map[string]*Config{} } - session = ctx.AdminSession.createUserAndLogin(false, nil, s(configType2.Id)) + session = ctx.AdminManagementSession.createUserAndLoginClientApi(false, nil, s(configType2.Id)) service3V.configs[configType2.Name] = config2 service4V.configs[configType2.Name] = config2 for _, service := range services { session.validateEntityWithQuery(service) } - session = ctx.AdminSession.createUserAndLogin(false, nil, s(configType1.Id, configType2.Id)) + session = ctx.AdminManagementSession.createUserAndLoginClientApi(false, nil, s(configType1.Id, configType2.Id)) service2V.configs[configType1.Name] = config1 service3V.configs[configType2.Name] = config2 service4V.configs[configType1.Name] = config3 @@ -258,7 +258,7 @@ func Test_ServiceListWithConfigs(t *testing.T) { service.configs = map[string]*Config{} } - session = ctx.AdminSession.createUserAndLogin(false, nil, s("all")) + session = ctx.AdminManagementSession.createUserAndLoginClientApi(false, nil, s("all")) service2V.configs[configType1.Name] = config1 service3V.configs[configType2.Name] = config2 service4V.configs[configType1.Name] = config3 @@ -268,14 +268,14 @@ func Test_ServiceListWithConfigs(t *testing.T) { } configs1 := []serviceConfig{{ServiceId: service4.Id, ConfigId: config1.Id}, {ServiceId: service4.Id, ConfigId: config5.Id}} - ctx.AdminSession.requireAssignIdentityServiceConfigs(session.identityId, configs1...) + ctx.AdminManagementSession.requireAssignIdentityServiceConfigs(session.identityId, configs1...) configs1 = []serviceConfig{{ServiceId: service4.Id, ConfigId: config1.Id}, {ServiceId: service4.Id, ConfigId: config5.Id}} sort.Sort(sortableServiceConfigSlice(configs1)) - currentConfigs := ctx.AdminSession.listIdentityServiceConfigs(session.identityId) + currentConfigs := ctx.AdminManagementSession.listIdentityServiceConfigs(session.identityId) ctx.Req.Equal(configs1, currentConfigs) configs2 := []serviceConfig{{ServiceId: service1.Id, ConfigId: config5.Id}, {ServiceId: service3.Id, ConfigId: config1.Id}, {ServiceId: service3.Id, ConfigId: config4.Id}} - ctx.AdminSession.requireAssignIdentityServiceConfigs(session.identityId, configs2...) + ctx.AdminManagementSession.requireAssignIdentityServiceConfigs(session.identityId, configs2...) checkConfigs := []serviceConfig{ {ServiceId: service4.Id, ConfigId: config1.Id}, {ServiceId: service4.Id, ConfigId: config5.Id}, @@ -284,7 +284,7 @@ func Test_ServiceListWithConfigs(t *testing.T) { {ServiceId: service3.Id, ConfigId: config4.Id}, } sort.Sort(sortableServiceConfigSlice(checkConfigs)) - currentConfigs = ctx.AdminSession.listIdentityServiceConfigs(session.identityId) + currentConfigs = ctx.AdminManagementSession.listIdentityServiceConfigs(session.identityId) ctx.Req.Equal(checkConfigs, currentConfigs) service1V.configs[configType3.Name] = config5 @@ -297,8 +297,8 @@ func Test_ServiceListWithConfigs(t *testing.T) { service.configs = map[string]*Config{} } - ctx.AdminSession.requireRemoveIdentityServiceConfigs(session.identityId, serviceConfig{ServiceId: service1.Id, ConfigId: config5.Id}, serviceConfig{ServiceId: service3.Id, ConfigId: config1.Id}) - currentConfigs = ctx.AdminSession.listIdentityServiceConfigs(session.identityId) + ctx.AdminManagementSession.requireRemoveIdentityServiceConfigs(session.identityId, serviceConfig{ServiceId: service1.Id, ConfigId: config5.Id}, serviceConfig{ServiceId: service3.Id, ConfigId: config1.Id}) + currentConfigs = ctx.AdminManagementSession.listIdentityServiceConfigs(session.identityId) checkConfigs = []serviceConfig{ {ServiceId: service4.Id, ConfigId: config1.Id}, {ServiceId: service4.Id, ConfigId: config5.Id}, @@ -317,8 +317,8 @@ func Test_ServiceListWithConfigs(t *testing.T) { service.configs = map[string]*Config{} } - ctx.AdminSession.requireRemoveIdentityServiceConfigs(session.identityId) - currentConfigs = ctx.AdminSession.listIdentityServiceConfigs(session.identityId) + ctx.AdminManagementSession.requireRemoveIdentityServiceConfigs(session.identityId) + currentConfigs = ctx.AdminManagementSession.listIdentityServiceConfigs(session.identityId) ctx.Req.Equal(0, len(currentConfigs)) service2V.configs[configType1.Name] = config1 @@ -334,22 +334,22 @@ func Test_ServiceListWithConfigDuplicate(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - configType1 := ctx.AdminSession.requireCreateNewConfigType() + configType1 := ctx.AdminManagementSession.requireCreateNewConfigType() - config1 := ctx.AdminSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ + config1 := ctx.AdminManagementSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ "hostname": "foo", "port": float64(22), }) - config2 := ctx.AdminSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ + config2 := ctx.AdminManagementSession.requireCreateNewConfig(configType1.Id, map[string]interface{}{ "hostname": "bar", "port": float64(80), }) service := ctx.newService(nil, s(config1.Id, config2.Id)) - resp := ctx.AdminSession.createEntity(service) + resp := ctx.AdminManagementSession.createEntity(service) ctx.requireFieldError(resp.StatusCode(), resp.Body(), errorz.CouldNotValidateCode, "configs") } @@ -357,30 +357,30 @@ func Test_ServiceRoleAttributes(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("role attributes should be created", func(t *testing.T) { ctx.testContextChanged(t) role1 := eid.New() role2 := eid.New() - service := ctx.AdminSession.requireNewService(s(role1, role2), nil) + service := ctx.AdminManagementSession.requireNewService(s(role1, role2), nil) service.permissions = []string{"Dial", "Bind"} - ctx.AdminSession.validateEntityWithQuery(service) - ctx.AdminSession.validateEntityWithLookup(service) + ctx.AdminManagementSession.validateEntityWithQuery(service) + ctx.AdminManagementSession.validateEntityWithLookup(service) }) t.Run("role attributes should be updated", func(t *testing.T) { ctx.testContextChanged(t) role1 := eid.New() role2 := eid.New() - service := ctx.AdminSession.requireNewService(s(role1, role2), nil) + service := ctx.AdminManagementSession.requireNewService(s(role1, role2), nil) service.permissions = []string{"Dial", "Bind"} role3 := eid.New() service.roleAttributes = []string{role2, role3} - ctx.AdminSession.requireUpdateEntity(service) - ctx.AdminSession.validateEntityWithLookup(service) + ctx.AdminManagementSession.requireUpdateEntity(service) + ctx.AdminManagementSession.validateEntityWithLookup(service) }) t.Run("role attributes should be queryable", func(t *testing.T) { @@ -392,18 +392,18 @@ func Test_ServiceRoleAttributes(t *testing.T) { role4 := prefix + "field-ops" role5 := prefix + "executive" - ctx.AdminSession.requireNewService(s(role1, role2), nil) - ctx.AdminSession.requireNewService(s(role2, role3), nil) - ctx.AdminSession.requireNewService(s(role3, role4), nil) - service := ctx.AdminSession.requireNewService(s(role5), nil) - ctx.AdminSession.requireNewService(nil, nil) + ctx.AdminManagementSession.requireNewService(s(role1, role2), nil) + ctx.AdminManagementSession.requireNewService(s(role2, role3), nil) + ctx.AdminManagementSession.requireNewService(s(role3, role4), nil) + service := ctx.AdminManagementSession.requireNewService(s(role5), nil) + ctx.AdminManagementSession.requireNewService(nil, nil) - list := ctx.AdminSession.requireList("service-role-attributes") + list := ctx.AdminManagementSession.requireList("service-role-attributes") ctx.Req.True(len(list) >= 5) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4, role5)) filter := url.QueryEscape(`id contains "e" and id contains "` + prefix + `" sort by id`) - list = ctx.AdminSession.requireList("service-role-attributes?filter=" + filter) + list = ctx.AdminManagementSession.requireList("service-role-attributes?filter=" + filter) ctx.Req.Equal(4, len(list)) expected := []string{role1, role3, role4, role5} @@ -411,8 +411,8 @@ func Test_ServiceRoleAttributes(t *testing.T) { ctx.Req.Equal(expected, list) service.roleAttributes = nil - ctx.AdminSession.requireUpdateEntity(service) - list = ctx.AdminSession.requireList("service-role-attributes") + ctx.AdminManagementSession.requireUpdateEntity(service) + list = ctx.AdminManagementSession.requireList("service-role-attributes") ctx.Req.True(len(list) >= 4) ctx.Req.True(stringz.ContainsAll(list, role1, role2, role3, role4)) ctx.Req.False(stringz.Contains(list, role5)) diff --git a/tests/specs_test.go b/tests/specs_test.go index f0b98316e..e37390f5c 100644 --- a/tests/specs_test.go +++ b/tests/specs_test.go @@ -37,7 +37,7 @@ func Test_Specs(t *testing.T) { t.Run("specs can be listed", func(t *testing.T) { ctx.testContextChanged(t) var err error - resp, err = ctx.unauthenticatedSession().newRequest(ctx).Get("edge/v1/specs") + resp, err = ctx.newAnonymousClientApiRequest().Get("specs") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -54,14 +54,14 @@ func Test_Specs(t *testing.T) { id := children[0].Path("id").Data().(string) - ctx.Req.Equal("swagger", id) + ctx.Req.Equal("edge-client", id) }) }) t.Run("swagger spec can be detailed", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.unauthenticatedSession().newRequest(ctx).Get("edge/v1/specs/swagger") + resp, err := ctx.newAnonymousClientApiRequest().Get("specs/edge-client") ctx.Req.NoError(err) standardJsonResponseTests(resp, http.StatusOK, t) @@ -74,16 +74,16 @@ func Test_Specs(t *testing.T) { data := parsed.Path("data") id := data.Path("id").Data().(string) - ctx.Req.Equal("swagger", id) + ctx.Req.Equal("edge-client", id) }) }) t.Run("swagger spec body can be retrieved as text/yaml", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.unauthenticatedSession().newRequest(ctx). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "text/yaml"). - Get("edge/v1/specs/swagger/spec") + Get("specs/edge-client/spec") ctx.Req.NoError(err) t.Run("has a 200 ok status", func(t *testing.T) { @@ -113,9 +113,9 @@ func Test_Specs(t *testing.T) { t.Run("swagger spec body can be retrieved as application/json", func(t *testing.T) { ctx.testContextChanged(t) - resp, err := ctx.unauthenticatedSession().newRequest(ctx). + resp, err := ctx.newAnonymousClientApiRequest(). SetHeader("accept", "application/json"). - Get("edge/v1/specs/swagger/spec") + Get("specs/edge-client/spec") ctx.Req.NoError(err) t.Run("has a 200 ok status", func(t *testing.T) { diff --git a/tests/standard_error_test.go b/tests/standard_error_test.go index c3af2a178..4f86982ca 100644 --- a/tests/standard_error_test.go +++ b/tests/standard_error_test.go @@ -29,17 +29,17 @@ func Test_StandardErrorMessages(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("405 method not allowed returns a standard error", func(t *testing.T) { req := require.New(t) - resp, err := ctx.AdminSession.newAuthenticatedJsonRequest(`{}`).Post("/version") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequestWithBody(`{}`).Post("/version") req.NoError(err) standardErrorJsonResponseTests(resp, apierror.MethodNotAllowedCode, apierror.MethodNotAllowedStatus, t) }) t.Run("404 not found returns a standard error", func(t *testing.T) { req := require.New(t) - resp, err := ctx.AdminSession.newAuthenticatedRequest().Get("/i-do-not-exist") + resp, err := ctx.AdminManagementSession.newAuthenticatedRequest().Get("/i-do-not-exist") req.NoError(err) standardErrorJsonResponseTests(resp, errorz.NotFoundCode, errorz.NotFoundStatus, t) }) diff --git a/tests/terminator_test.go b/tests/terminator_test.go index 4243fa60d..3dd757d3f 100644 --- a/tests/terminator_test.go +++ b/tests/terminator_test.go @@ -24,14 +24,14 @@ func Test_Terminators(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - service := ctx.AdminSession.requireNewService(nil, nil) + service := ctx.AdminManagementSession.requireNewService(nil, nil) edgeRouter := ctx.createAndEnrollEdgeRouter(false) - terminator := ctx.AdminSession.requireNewTerminator(service.Id, edgeRouter.id, "transport", "tcp:localhost:2020") + terminator := ctx.AdminManagementSession.requireNewTerminator(service.Id, edgeRouter.id, "transport", "tcp:localhost:2020") ctx.Req.NotEmpty(terminator.id) - ctx.AdminSession.validateEntityWithQuery(terminator) - ctx.AdminSession.validateEntityWithLookup(terminator) - ctx.AdminSession.validateAssociations(service, terminator.getEntityType(), terminator) + ctx.AdminManagementSession.validateEntityWithQuery(terminator) + ctx.AdminManagementSession.validateEntityWithLookup(terminator) + ctx.AdminManagementSession.validateAssociations(service, terminator.getEntityType(), terminator) } diff --git a/tests/terminator_update_test.go b/tests/terminator_update_test.go index d115f72f4..f7eebace1 100644 --- a/tests/terminator_update_test.go +++ b/tests/terminator_update_test.go @@ -28,13 +28,13 @@ func Test_UpdateTerminators(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() ctx.CreateEnrollAndStartEdgeRouter() - service := ctx.AdminSession.RequireNewServiceAccessibleToAll("smartrouting") + service := ctx.AdminManagementSession.RequireNewServiceAccessibleToAll("smartrouting") - _, context := ctx.AdminSession.RequireCreateSdkContext() + _, context := ctx.AdminManagementSession.RequireCreateSdkContext() defer context.Close() listener, err := context.Listen(service.Name) @@ -42,7 +42,7 @@ func Test_UpdateTerminators(t *testing.T) { ctx.requireNListener(1, listener, time.Second) defer func() { _ = listener.Close() }() - terminators := ctx.AdminSession.listTerminators(`binding="edge"`) + terminators := ctx.AdminManagementSession.listTerminators(`binding="edge"`) ctx.Req.Equal(1, len(terminators)) term := terminators[0] ctx.Req.Equal(0, term.cost) @@ -54,7 +54,7 @@ func Test_UpdateTerminators(t *testing.T) { time.Sleep(25 * time.Millisecond) // update is async, so need to give a little time to process term.cost = 999 - ctx.AdminSession.validateEntityWithLookup(term) + ctx.AdminManagementSession.validateEntityWithLookup(term) err = listener.UpdatePrecedence(edge.PrecedenceRequired) ctx.Req.NoError(err) @@ -62,7 +62,7 @@ func Test_UpdateTerminators(t *testing.T) { time.Sleep(25 * time.Millisecond) // update is async, so need to give a little time to process term.precedence = "required" - ctx.AdminSession.validateEntityWithLookup(term) + ctx.AdminManagementSession.validateEntityWithLookup(term) err = listener.UpdateCostAndPrecedence(585, edge.PrecedenceFailed) ctx.Req.NoError(err) @@ -71,6 +71,6 @@ func Test_UpdateTerminators(t *testing.T) { term.cost = 585 term.precedence = "failed" - ctx.AdminSession.validateEntityWithLookup(term) + ctx.AdminManagementSession.validateEntityWithLookup(term) } diff --git a/tests/transit_router_test.go b/tests/transit_router_test.go index 3b0a3e214..d65f8e112 100644 --- a/tests/transit_router_test.go +++ b/tests/transit_router_test.go @@ -29,7 +29,7 @@ func Test_TransitRouters(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() t.Run("transit routers can be created and enrolled", func(t *testing.T) { ctx.testContextChanged(t) @@ -43,15 +43,15 @@ func Test_TransitRouters(t *testing.T) { t.Run("transit routers can be created, enrolled, and listed", func(t *testing.T) { ctx.testContextChanged(t) - ctx.AdminSession.requireQuery("transit-routers") + ctx.AdminManagementSession.requireQuery("transit-routers") }) t.Run("transit routers can be listed with enrolled and un-enrolled states", func(t *testing.T) { ctx.testContextChanged(t) ctx.createAndEnrollTransitRouter() - _ = ctx.AdminSession.requireNewTransitRouter() + _ = ctx.AdminManagementSession.requireNewTransitRouter() - body := ctx.AdminSession.requireQuery("transit-routers") + body := ctx.AdminManagementSession.requireQuery("transit-routers") ctx.logJson(body.Bytes()) t.Run("enrolled router is verified and has a fingerprint, un-enrolled router does not", func(t *testing.T) { @@ -88,14 +88,14 @@ func Test_TransitRouters(t *testing.T) { t.Run("create transit router, then delete", func(t *testing.T) { ctx.testContextChanged(t) - router := ctx.AdminSession.requireNewTransitRouter() - ctx.AdminSession.requireDeleteEntity(router) + router := ctx.AdminManagementSession.requireNewTransitRouter() + ctx.AdminManagementSession.requireDeleteEntity(router) }) t.Run("create & enroll transit router, then delete", func(t *testing.T) { ctx.testContextChanged(t) router := ctx.createAndEnrollTransitRouter() - ctx.AdminSession.requireDeleteEntity(router) + ctx.AdminManagementSession.requireDeleteEntity(router) }) t.Run("can list transit routers created in fabric", func(t *testing.T) { @@ -116,7 +116,7 @@ func Test_TransitRouters(t *testing.T) { err := ctx.fabricController.GetNetwork().Routers.Create(fabTxRouter) ctx.Req.NoError(err, "could not create router at fabric level") - body := ctx.AdminSession.requireQuery("transit-routers") + body := ctx.AdminManagementSession.requireQuery("transit-routers") ctx.logJson(body.Bytes()) }) } diff --git a/tests/tunneler_data_flow_test.go b/tests/tunneler_data_flow_test.go index 4d21d1418..4a9107e99 100644 --- a/tests/tunneler_data_flow_test.go +++ b/tests/tunneler_data_flow_test.go @@ -37,12 +37,12 @@ func Test_TunnelerDataflowTcp(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - ctx.AdminSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) hostConfig := ctx.newConfig("NH5p4FpGR", map[string]interface{}{ "address": "localhost", @@ -51,15 +51,15 @@ func Test_TunnelerDataflowTcp(t *testing.T) { "allowedProtocols": []string{"tcp", "udp"}, }) hostConfig.Name = "tunnel-host" - ctx.AdminSession.requireCreateEntity(hostConfig) + ctx.AdminManagementSession.requireCreateEntity(hostConfig) - service := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service.Name = "tunnel-test-tcp" - ctx.AdminSession.requireCreateEntity(service) + ctx.AdminManagementSession.requireCreateEntity(service) - service2 := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service2 := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service2.Name = "tunnel-test-udp" - ctx.AdminSession.requireCreateEntity(service2) + ctx.AdminManagementSession.requireCreateEntity(service2) ctx.CreateEnrollAndStartTunnelerEdgeRouter() l, err := net.Listen("tcp", "localhost:8687") @@ -166,12 +166,12 @@ func Test_TunnelerDataflowHalfClose(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - ctx.AdminSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) hostConfig := ctx.newConfig("NH5p4FpGR", map[string]interface{}{ "address": "localhost", @@ -180,15 +180,15 @@ func Test_TunnelerDataflowHalfClose(t *testing.T) { "allowedProtocols": []string{"tcp", "udp"}, }) hostConfig.Name = "tunnel-host" - ctx.AdminSession.requireCreateEntity(hostConfig) + ctx.AdminManagementSession.requireCreateEntity(hostConfig) - service := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service.Name = "tunnel-test-tcp" - ctx.AdminSession.requireCreateEntity(service) + ctx.AdminManagementSession.requireCreateEntity(service) - service2 := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service2 := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service2.Name = "tunnel-test-udp" - ctx.AdminSession.requireCreateEntity(service2) + ctx.AdminManagementSession.requireCreateEntity(service2) ctx.CreateEnrollAndStartTunnelerEdgeRouter() l, err := net.Listen("tcp", "localhost:8689") @@ -305,12 +305,12 @@ func Test_TunnelerDataflowUdp(t *testing.T) { ctx := NewTestContext(t) defer ctx.Teardown() ctx.StartServer() - ctx.RequireAdminLogin() + ctx.RequireAdminManagementApiLogin() - ctx.AdminSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) - ctx.AdminSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) - ctx.AdminSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServicePolicy("Dial", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewServicePolicy("Bind", s("#all"), s("#all"), nil) + ctx.AdminManagementSession.requireNewEdgeRouterPolicy(s("#all"), s("#all")) + ctx.AdminManagementSession.requireNewServiceEdgeRouterPolicy(s("#all"), s("#all")) hostConfig := ctx.newConfig("NH5p4FpGR", map[string]interface{}{ "address": "localhost", @@ -319,15 +319,15 @@ func Test_TunnelerDataflowUdp(t *testing.T) { "allowedProtocols": []string{"tcp", "udp"}, }) hostConfig.Name = "tunnel-host" - ctx.AdminSession.requireCreateEntity(hostConfig) + ctx.AdminManagementSession.requireCreateEntity(hostConfig) - service := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service.Name = "tunnel-test-tcp" - ctx.AdminSession.requireCreateEntity(service) + ctx.AdminManagementSession.requireCreateEntity(service) - service2 := ctx.AdminSession.testContext.newService(nil, s(hostConfig.Id)) + service2 := ctx.AdminManagementSession.testContext.newService(nil, s(hostConfig.Id)) service2.Name = "tunnel-test-udp" - ctx.AdminSession.requireCreateEntity(service2) + ctx.AdminManagementSession.requireCreateEntity(service2) ctx.CreateEnrollAndStartTunnelerEdgeRouter() l, err := net.ListenPacket("udp", "localhost:8690") From 46eb2cfdcdfd940f2fb7bc3ece7114e4ea5d4c7c Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Tue, 4 May 2021 16:26:30 -0400 Subject: [PATCH 2/2] remove swagger.yml --- specs/swagger.yml | 8055 --------------------------------------------- 1 file changed, 8055 deletions(-) delete mode 100644 specs/swagger.yml diff --git a/specs/swagger.yml b/specs/swagger.yml deleted file mode 100644 index a3b85a1d0..000000000 --- a/specs/swagger.yml +++ /dev/null @@ -1,8055 +0,0 @@ ---- -swagger: '2.0' -info: - version: 0.16.3 - title: Ziti Edge - contact: { } -host: demo.ziti.dev -basePath: /edge/v1 -schemes: - - https -consumes: - - application/json -produces: - - application/json -securityDefinitions: - ztSession: - type: apiKey - in: header - name: zt-session - description: An API Key that is provided post authentication - -####################################################################################################################### -# -# Paths - Endpoints and their associated HTTP methods -# -####################################################################################################################### -paths: - ################################################################### - # .well-known RFC - ################################################################## - '/.well-known/est/cacerts': - get: - summary: Get CA Cert Store - description: | - 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. - security: [ ] - tags: - - Well Known - operationId: listWellKnownCas - produces: - - application/pkcs7-mime - responses: - '200': - description: A base64 encoded PKCS7 store - schema: - type: string - example: 'MIIMUQYJKoZIhvcNAQcCoIIMQjCCDD4CAQExADALBgkqhkiG9w0BBwGgggwkMIIG - BjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw - FQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD - VQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl - IEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx - ODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI - DA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg - TmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv - dW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC - CgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z - KIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ - NJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa - VK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl - 7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s - 6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb - QGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010 - XdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU - He16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW - ghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb - ryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw - HQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu - OuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD - AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE - gRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS - Cpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7 - KOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+ - rMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X - 6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI - Fximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN - 8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw - BHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2 - YSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo - LLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq - dH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB - lzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH - DAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv - dW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5 - IFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG - A1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy - bG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg - Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg - Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD - DIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw - HDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f - WsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV - XO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv - pnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD - w2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI - KyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo - 783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm - pQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE - WFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F - 6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa - bADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD - VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB - ACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy - 3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY - uEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn - cCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS - WI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg - AX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO - wEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y - qQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m - fGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh - dprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8 - 3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA==' - '/': - get: - summary: Returns version information - security: [ ] - tags: - - Informational - operationId: listRoot - responses: - '200': - $ref: '#/responses/listVersion' - '/version': - get: - summary: Returns version information - security: [ ] - tags: - - Informational - operationId: listVersion - responses: - '200': - $ref: '#/responses/listVersion' - '/protocols': - get: - summary: Return a list of the listening Edge protocols - security: [ ] - tags: - - Informational - operationId: listProtocols - responses: - '200': - $ref: '#/responses/listProtocols' - ################################################################### - # Informational - ################################################################## - '/summary': - get: - summary: Returns a list of accessible resource counts - description: This endpoint is usefull for UIs that wish to display UI elements with counts. - security: - - ztSession: [ ] - tags: - - Informational - operationId: listSummary - responses: - '200': - $ref: '#/responses/listSummaryCounts' - '401': - $ref: '#/responses/unauthorizedResponse' - '/specs': - get: - summary: Returns a list of API specs - description: Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion - security: [ ] - tags: - - Informational - operationId: listSpecs - responses: - '200': - $ref: '#/responses/listSpecs' - '/specs/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Return a single spec resource - description: Returns single spec resource embedded within the controller for consumption/documentation/code geneartion - security: [ ] - tags: - - Informational - operationId: detailSpec - responses: - '200': - $ref: '#/responses/detailSpec' - '/specs/{id}/spec': - parameters: - - $ref: '#/parameters/id' - get: - summary: Returns the spec's file - description: Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). - security: [ ] - tags: - - Informational - operationId: detailSpecBody - produces: - - text/yaml - - application/json - responses: - '200': - $ref: '#/responses/detailSpecBody' - ################################################################### - # API Sessions - ################################################################## - '/api-sessions': - get: - summary: List active API sessions - description: | - Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint - requries admin access. - security: - - ztSession: [ ] - tags: - - API Session - operationId: listAPISessions - produces: - - application/json; charset=utf-8 - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listAPISessions' - '/api-sessions/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single API Session - description: Retrieves a single API Session by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - API Session - operationId: detailAPISessions - responses: - '200': - $ref: '#/responses/detailAPISession' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Deletes an API Sessions - description: Deletes and API sesion by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - API Session - operationId: deleteAPISessions - responses: - '200': - $ref: '#/responses/deleteResponse' - '404': - $ref: '#/responses/notFoundResponse' - '403': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Authentication - ################################################################## - '/authenticate': - parameters: - - $ref: '#/parameters/authMethod' - post: - summary: Authenticate via a method supplied via a query string parameter - description: | - Allows authentication Methods include "password" and "cert" - security: [ ] - tags: - - Authentication - operationId: authenticate - parameters: - - name: auth - in: body - required: false - schema: - $ref: '#/definitions/authenticate' - responses: - '200': - $ref: '#/responses/detailCurrentAPISession' - '400': - $ref: '#/responses/badRequestResponse' - '403': - $ref: '#/responses/invalidAuthResponse' - - '/authenticate/mfa': - post: - summary: Complete MFA authentication - description: Completes MFA authentication by submitting a MFA time based one time token or backup code. - security: - - ztSession: [ ] - tags: - - Authentication - - MFA - operationId: authenticateMfa - parameters: - - name: mfaAuth - in: body - required: true - description: 'An MFA validation request' - schema: - $ref: '#/definitions/mfaCode' - responses: - '200': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/emptyResponse' - ################################################################### - # Authenticators - ################################################################## - '/authenticators': - get: - summary: List authenticators - description: | - Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated. - This endpoint requries admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: listAuthenticators - - responses: - '200': - $ref: '#/responses/listAuthenticators' - post: - summary: Creates an authenticator - description: | - Creates an authenticator for a specific identity. Requires admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: createAuthenticator - parameters: - - name: authenticator - in: body - required: true - description: A Authenticator create object - schema: - $ref: '#/definitions/authenticatorCreate' - responses: - '201': - description: The create was successful - schema: - $ref: '#/definitions/authenticatorCreate' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/authenticators/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single authenticator - description: Retrieves a single authenticator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: detailAuthenticator - responses: - '200': - $ref: '#/responses/detailAuthenticator' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on an authenticator - description: Update all fields on an authenticator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: updateAuthenticator - parameters: - - name: authenticator - in: body - required: true - description: 'An authenticator put object' - schema: - $ref: '#/definitions/authenticatorUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on an authenticator - description: Update the supplied fields on an authenticator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: patchAuthenticator - parameters: - - name: authenticator - in: body - required: true - description: An authenticator patch object - schema: - $ref: '#/definitions/authenticatorPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an Authenticator - description: | - Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in. - Requires admin access. - security: - - ztSession: [ ] - tags: - - Authenticator - operationId: deleteAuthenticator - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Certificate Authorities - ################################################################## - '/cas': - get: - summary: List CAs - description: Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: listCas - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listCas' - post: - summary: Creates a CA - description: Creates a CA in an unverified state. Requires admin access. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: createCa - - parameters: - - name: ca - in: body - required: true - description: A CA to create - schema: - $ref: '#/definitions/caCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/cas/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single CA - description: Retrieves a single CA by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: detailCa - responses: - '200': - $ref: '#/responses/detailCa' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a CA - description: Update all fields on a CA by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: updateCa - parameters: - - name: ca - in: body - required: true - description: A CA update object - schema: - $ref: '#/definitions/caUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a CA - description: Update only the supplied fields on a CA by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: patchCa - parameters: - - name: ca - in: body - required: true - description: A CA patch object - schema: - $ref: '#/definitions/caPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a CA - description: | - 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. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: deleteCa - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/cas/{id}/jwt': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieve the enrollment JWT for a CA - description: | - For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides - the jwt as a text response. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: getCaJwt - produces: - - 'application/jwt' - 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' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/cas/{id}/verify': - parameters: - - $ref: '#/parameters/id' - post: - summary: Verify a CA - description: | - 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. - security: - - ztSession: [ ] - tags: - - Certificate Authority - operationId: verifyCa - consumes: - - 'text/plain' - parameters: - - name: certificate - required: true - in: body - description: A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken - schema: - type: string - responses: - 200: - $ref: '#/responses/emptyResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Config-Types - ################################################################## - '/config-types': - get: - summary: List config-types - description: | - Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: listConfigTypes - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listConfigTypes' - post: - summary: Create a config-type. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: createConfigType - parameters: - - name: configType - in: body - required: true - description: A config-type to create - schema: - $ref: '#/definitions/configTypeCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/config-types/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single config-type - description: Retrieves a single config-type by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: detailConfigType - responses: - '200': - $ref: '#/responses/detailConfigType' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a config-type - description: Update all fields on a config-type by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: updateConfigType - parameters: - - name: configType - in: body - required: true - description: A config-type update object - schema: - $ref: '#/definitions/configTypeUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a config-type - description: Update the supplied fields on a config-type. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: patchConfigType - parameters: - - name: configType - in: body - required: true - description: A config-type patch object - schema: - $ref: '#/definitions/configTypePatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a config-type - 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. - security: - - ztSession: [ ] - tags: - - Config - operationId: deleteConfigType - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/config-types/{id}/configs': - parameters: - - $ref: '#/parameters/id' - get: - summary: Lists the configs of a specific config-type - description: Lists the configs associated to a config-type. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: listConfigsForConfigType - responses: - '200': - $ref: '#/responses/listConfigs' - ################################################################### - # Configs - ################################################################## - '/configs': - get: - summary: List configs - description: | - Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: listConfigs - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listConfigs' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a config resource - description: Create a config resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: createConfig - parameters: - - name: config - in: body - required: true - description: A config to create - schema: - $ref: '#/definitions/configCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/configs/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single config - description: Retrieves a single config by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: detailConfig - responses: - '200': - $ref: '#/responses/detailConfig' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a config - description: Update all fields on a config by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: updateConfig - parameters: - - name: config - in: body - required: true - description: A config update object - schema: - $ref: '#/definitions/configUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a config - description: Update the supplied fields on a config. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: patchConfig - parameters: - - name: config - in: body - required: true - description: A config patch object - schema: - $ref: '#/definitions/configPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a config - description: Delete a config by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Config - operationId: deleteConfig - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - - ################################################################### - # Current API Session - ################################################################## - '/current-api-session': - get: - summary: Return the current API session - description: Retrieves the API session that was used to issue the current request - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: getCurrentAPISession - responses: - 200: - $ref: '#/responses/detailCurrentAPISession' - 401: - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Logout - description: Terminates the current API session - security: - - ztSession: [ ] - tags: - - Current API Session - responses: - 200: - $ref: '#/responses/emptyResponse' - 401: - $ref: '#/responses/unauthorizedResponse' - '/current-api-session/certificates': - get: - summary: List the ephemeral certificates available for the current API Session - description: Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: listCurrentApiSessionCertificates - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listCurrentApiSessionCertificates' - post: - summary: Creates an ephemeral certificate for the current API Session - 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. - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: createCurrentApiSessionCertificate - parameters: - - name: sessionCertificate - in: body - required: true - description: The payload describing the CSR used to create a session certificate - schema: - $ref: '#/definitions/currentApiSessionCertificateCreate' - responses: - '201': - $ref: '#/responses/createCurrentApiSessionCertificateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/current-api-session/certificates/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves an ephemeral certificate - description: Retrieves a single ephemeral certificate by id - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: detailCurrentApiSessionCertificate - responses: - '200': - $ref: '#/responses/detailCurrentApiSessionCertificate' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an ephemeral certificate - description: | - Delete an ephemeral certificateby id - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: deleteCurrentApiSessionCertificate - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Current API Session - Service Updates - ################################################################# - '/current-api-session/service-updates': - get: - summary: Returns data indicating whether a client should updates it service list - description: | - Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate - service refreshes. - security: - - ztSession: [ ] - tags: - - Current API Session - - Services - operationId: listServiceUpdates - responses: - '200': - $ref: '#/responses/listCurrentApiSessionServiceUpdates' - '401': - $ref: '#/responses/unauthorizedResponse' - - - '/current-identity': - get: - summary: Return the current identity - description: Returns the identity associated with the API sessions used to issue the current request - security: - - ztSession: [ ] - tags: - - Current Identity - operationId: getCurrentIdentity - responses: - '200': - $ref: '#/responses/detailCurrentIdentity' - '401': - $ref: '#/responses/unauthorizedResponse' - '/current-identity/edge-routers': - get: - summary: Return this list of Edge Routers the identity has access to - description: | - Lists the Edge Routers that the current identity has access to via policies. The data returned - includes their address and online status - security: - - ztSession: [ ] - tags: - - Current Identity - - Edge Router - operationId: getCurrentIdentityEdgeRouters - responses: - '200': - $ref: '#/responses/listCurrentIdentityEdgeRouters' - '401': - $ref: '#/responses/unauthorizedResponse' - '/current-identity/mfa': - post: - summary: Initiate MFA enrollment - 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` - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: enrollMfa - responses: - '201': - $ref: '#/responses/createResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/alreadyMfaEnrolledResponse' - get: - summary: Returns the current status of MFA enrollment - 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`. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: detailMfa - responses: - '200': - $ref: '#/responses/detailMfa' - '401': - $ref: '#/responses/unauthorizedResponse' - '404': - $ref: '#/responses/notFoundResponse' - delete: - summary: Disable MFA for the current identity - 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//mfa`. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: deleteMfa - parameters: - - name: mfaValidation - in: body - required: false - description: 'An MFA validation request' - schema: - $ref: '#/definitions/mfaCode' - - name: mfa-validation-code - in: header - required: false - type: string - responses: - '200': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '404': - $ref: '#/responses/notFoundResponse' - '/current-identity/mfa/qr-code': - get: - summary: Show a QR code for unverified MFA enrollments - description: > - Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or - not started. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: detailMfaQrCode - produces: - - image/png - - application/json - responses: - 200: - description: OK - 404: - description: No MFA enrollment or MFA enrollment is completed - '/current-identity/mfa/verify': - post: - summary: Complete MFA enrollment by verifying a time based one time token - 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`. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: verifyMfa - parameters: - - name: mfaValidation - in: body - required: true - description: 'An MFA validation request' - schema: - $ref: '#/definitions/mfaCode' - responses: - '200': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '404': - $ref: '#/responses/notFoundResponse' - '/current-identity/mfa/recovery-codes': - get: - summary: For a completed MFA enrollment view the current recovery codes - 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. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: detailMfaRecoveryCodes - parameters: - - name: mfaValidation - in: body - required: false - description: 'An MFA validation request' - schema: - $ref: '#/definitions/mfaCode' - - name: mfa-validation-code - in: header - required: false - type: string - responses: - '200': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '404': - $ref: '#/responses/notFoundResponse' - post: - summary: For a completed MFA enrollment regenerate the recovery codes - 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. - security: - - ztSession: [ ] - tags: - - Current Identity - - MFA - operationId: createMfaRecoveryCodes - parameters: - - name: mfaValidation - in: body - required: true - description: 'An MFA validation request' - schema: - $ref: '#/definitions/mfaCode' - responses: - '200': - $ref: '#/responses/detailMfaRecoveryCodes' - '401': - $ref: '#/responses/unauthorizedResponse' - '404': - $ref: '#/responses/notFoundResponse' - '/current-identity/authenticators': - get: - summary: List authenticators for the current identity - description: Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: listCurrentIdentityAuthenticators - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listAuthenticators' - '401': - $ref: '#/responses/unauthorizedResponse' - '/current-identity/authenticators/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieve an authenticator for the current identity - description: Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: detailCurrentIdentityAuthenticator - responses: - '200': - $ref: '#/responses/detailAuthenticator' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on an authenticator of this identity - description: | - Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's - identity. - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: updateCurrentIdentityAuthenticator - parameters: - - name: authenticator - in: body - required: true - description: 'An authenticator put object' - schema: - $ref: '#/definitions/authenticatorUpdateWithCurrent' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on an authenticator of this identity - description: | - Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API - session's identity. - security: - - ztSession: [ ] - tags: - - Current API Session - operationId: patchCurrentIdentityAuthenticator - parameters: - - name: authenticator - in: body - required: true - description: An authenticator patch object - schema: - $ref: '#/definitions/authenticatorPatchWithCurrent' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Edge Router Policies - ################################################################## - '/edge-router-policies': - get: - summary: List edge router policies - description: | - Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: listEdgeRouterPolicies - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listEdgeRouterPolicies' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create an edge router policy resource - description: Create an edge router policy resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: createEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: An edge router policy to create - schema: - $ref: '#/definitions/edgeRouterPolicyCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/edge-router-policies/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single edge router policy - description: Retrieves a single edge router policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: detailEdgeRouterPolicy - responses: - '200': - $ref: '#/responses/detailEdgeRouterPolicy' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on an edge router policy - description: Update all fields on an edge router policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: updateEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: An edge router policy update object - schema: - $ref: '#/definitions/edgeRouterPolicyUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on an edge router policy - description: Update the supplied fields on an edge router policy. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: patchEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: An edge router policy patch object - schema: - $ref: '#/definitions/edgeRouterPolicyPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an edge router policy - description: Delete an edge router policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: deleteEdgeRouterPolicy - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/edge-router-policies/{id}/edge-routers': - parameters: - - $ref: '#/parameters/id' - get: - summary: List edge routers a policy affects - description: | - Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: listEdgeRouterPolicyEdgeRouters - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/edge-router-policies/{id}/identities': - parameters: - - $ref: '#/parameters/id' - get: - summary: List identities an edge router policy affects - description: | - Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router Policy - operationId: listEdgeRouterPolicyIdentities - responses: - '200': - $ref: '#/responses/listIdentities' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Edge Routers - ################################################################## - '/edge-routers': - get: - summary: List edge routers - description: | - Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: listEdgeRouters - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - - $ref: '#/parameters/roleFilter' - - $ref: '#/parameters/roleSemantic' - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create an edge router - description: Create a edge router resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: createEdgeRouter - parameters: - - name: edgeRouter - in: body - required: true - description: A edge router to create - schema: - $ref: '#/definitions/edgeRouterCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/edge-routers/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single edge router - description: Retrieves a single edge router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: detailEdgeRouter - responses: - '200': - $ref: '#/responses/detailEdgeRouter' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on an edge router - description: Update all fields on an edge router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: updateEdgeRouter - parameters: - - name: edgeRouter - in: body - required: true - description: An edge router update object - schema: - $ref: '#/definitions/edgeRouterUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on an edge router - description: Update the supplied fields on an edge router. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: patchEdgeRouter - parameters: - - name: edgeRouter - in: body - required: true - description: An edge router patch object - schema: - $ref: '#/definitions/edgeRouterPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an edge router - description: Delete an edge router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: deleteEdgeRouter - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/edge-routers/{id}/edge-router-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the edge router policies that affect an edge router - description: Retrieves a list of edge router policies that apply to the specified edge router. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: listEdgeRouterEdgeRouterPolicies - responses: - '200': - $ref: '#/responses/listEdgeRouterPolicies' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/edge-routers/{id}/identities': - parameters: - - $ref: '#/parameters/id' - get: - summary: List associated identities - description: | - Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: listEdgeRouterIdentities - responses: - '200': - $ref: '#/responses/listIdentities' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/edge-routers/{id}/service-edge-router-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the service policies that affect an edge router - description: Retrieves a list of service policies policies that apply to the specified edge router. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: listEdgeRouterServiceEdgeRouterPolicies - responses: - '200': - $ref: '#/responses/listServicePolicies' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/edge-routers/{id}/services': - parameters: - - $ref: '#/parameters/id' - get: - summary: List associated services - description: | - Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Edge Router - operationId: listEdgeRouterServices - responses: - '200': - $ref: '#/responses/listServices' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Enroll - Identity - ################################################################## - '/enroll': - parameters: - - $ref: '#/parameters/token-optional' - post: - summary: Legacy enrollment endpoint - description: endpoint defers to the logic in the more specific `enroll/*` endpoints - operationId: enroll - tags: - - Enroll - consumes: - - application/pkcs10 - - application/json - - application/x-pem-file - - text/plain - produces: - #default to PEM for older clients that do not properly set/inspect accept/content-type headers - - application/x-pem-file - - application/json - responses: - '200': - $ref: '#/responses/emptyResponse' - '404': - $ref: '#/responses/notFoundResponse' - '/enroll/ca': - post: - summary: Enroll an identity with a pre-exchanged certificate - description: | - 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. - operationId: enrollCa - tags: - - Enroll - responses: - '200': - $ref: '#/responses/emptyResponse' - '404': - $ref: '#/responses/notFoundResponse' - '/enroll/ott': - parameters: - - $ref: '#/parameters/token' - post: - summary: Enroll an identity via one-time-token - description: | - 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. - operationId: enrollOtt - tags: - - Enroll - consumes: - - application/pkcs10 - produces: - - application/x-x509-user-cert - responses: - '200': - $ref: '#/responses/zitiSignedCert' - '404': - $ref: '#/responses/notFoundResponse' - '/enroll/ottca': - parameters: - - $ref: '#/parameters/token' - post: - summary: Enroll an identity via one-time-token with a pre-exchanged client certificate - description: | - 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. - operationId: enrollOttCa - tags: - - Enroll - responses: - '200': - $ref: '#/responses/emptyResponse' - '/enroll/updb': - parameters: - - $ref: '#/parameters/token' - post: - summary: Enroll an identity via one-time-token - description: | - Enrolls an identity via a one-time-token to establish an initial username and password combination - operationId: ernollUpdb - tags: - - Enroll - responses: - '200': - $ref: '#/responses/emptyResponse' - '404': - $ref: '#/responses/notFoundResponse' - ################################################################### - # Enroll - Routers - ################################################################## - '/enroll/erott': - parameters: - - $ref: '#/parameters/token' - post: - summary: Enroll an edge-router - description: | - Enrolls an edge-router via a one-time-token to establish a certificate based identity. - operationId: enrollErOtt - tags: - - Enroll - responses: - '200': - $ref: '#/responses/erottResponse' - - '/enroll/extend/router': - post: - summary: Extend the life of a currently enrolled router's certificates - description: | - 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 pased 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. 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. - operationId: extendRouterEnrollment - parameters: - - name: routerExtendEnrollmentRequest - in: body - required: true - schema: - $ref: '#/definitions/routerExtendEnrollmentRequest' - tags: - - Enroll - - Extend Enrollment - responses: - '200': - $ref: '#/responses/routerExtendEnrollmentResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Enrollments - ################################################################## - '/enrollments': - get: - summary: List outstanding enrollments - description: | - Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Enrollment - operationId: listEnrollments - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listEnrollments' - '401': - $ref: '#/responses/unauthorizedResponse' - '/enrollments/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves an outstanding enrollment - description: Retrieves a single outstanding enrollment by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Enrollment - operationId: detailEnrollment - responses: - '200': - $ref: '#/responses/detailEnrollment' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an outstanding enrollment - description: Delete an outstanding enrollment by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Enrollment - operationId: deleteEnrollment - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Geo Regions - ################################################################## - '/geo-regions': - get: - summary: List available geo-regions - description: | - Retrieves a list of geo-regions; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Geo Region - operationId: listGeoRegions - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listGeoRegions' - '401': - $ref: '#/responses/unauthorizedResponse' - '/geo-regions/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a geo-region - description: Retrieves a single geo-region by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Geo Region - operationId: detailGeoRegion - responses: - '200': - $ref: '#/responses/detailGeoRegion' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Identities - ################################################################## - '/identities': - get: - summary: List identities - description: | - Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentities - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - - $ref: '#/parameters/roleFilter' - - $ref: '#/parameters/roleSemantic' - responses: - '200': - $ref: '#/responses/listIdentities' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create an identity resource - description: Create an identity resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: createIdentity - parameters: - - name: identity - in: body - required: true - description: An identity to create - schema: - $ref: '#/definitions/identityCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single identity - description: Retrieves a single identity by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: detailIdentity - responses: - '200': - $ref: '#/responses/detailIdentity' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on an identity - description: Update all fields on an identity by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: updateIdentity - parameters: - - name: identity - in: body - required: true - description: An identity update object - schema: - $ref: '#/definitions/identityUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on an identity - description: Update the supplied fields on an identity. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: patchIdentity - parameters: - - name: identity - in: body - required: true - description: An identity patch object - schema: - $ref: '#/definitions/identityPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete an identity - description: Delete an identity by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: deleteIdentity - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/identities/{id}/edge-router-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the edge router policies that affect an idenitty - description: Retrieves a list of edge router policies that apply to the specified identity. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentitysEdgeRouterPolicies - responses: - '200': - $ref: '#/responses/listEdgeRouterPolicies' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}/service-configs': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the service configs associated a specific identity - description: Retrieves a list of service configs associated to a specific identity - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentitysServiceConfigs - responses: - '200': - $ref: '#/responses/listServiceConfigs' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Associate service configs for a specific identity - description: Associate service configs to a specific identity - parameters: - - name: serviceConfigs - in: body - required: true - description: A service config patch object - schema: - $ref: '#/definitions/serviceConfigsAssignList' - security: - - ztSession: [ ] - tags: - - Identity - operationId: associateIdentitysServiceConfigs - responses: - '200': - $ref: '#/responses/emptyResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Remove associated service configs from a specific identity - description: Remove service configs from a specific identity - parameters: - - name: serviceConfigIdPairs - in: body - required: false - description: An array of service and config id pairs to remove - schema: - $ref: '#/definitions/serviceConfigsAssignList' - security: - - ztSession: [ ] - tags: - - Identity - operationId: disassociateIdentitysServiceConfigs - responses: - '200': - $ref: '#/responses/emptyResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}/service-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the service policies that affect an identity - description: Retrieves a list of service policies that apply to the specified identity. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentityServicePolicies - responses: - '200': - $ref: '#/responses/listServicePolicies' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/identities/{id}/edge-routers': - parameters: - - $ref: '#/parameters/id' - get: - summary: List accessible edge-routers - description: | - Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentityEdgeRouters - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/identities/{id}/services': - parameters: - - $ref: '#/parameters/id' - get: - summary: List accessible services - description: | - Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentityServices - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/identities/{id}/policy-advice/{serviceId}': - parameters: - - $ref: '#/parameters/id' - - $ref: '#/parameters/serviceId' - get: - summary: Analyze policies relating the given identity and service - description: | - 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. - security: - - ztSession: [ ] - tags: - - Identity - operationId: getIdentityPolicyAdvice - responses: - '200': - $ref: '#/responses/getIdentityPolicyAdvice' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}/posture-data': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieve the curent posture data for a specific identity. - description: | - Returns a nested map data represeting the posture data of the identity. - This data should be considered volatile. - security: - - ztSession: [ ] - tags: - - Identity - operationId: getIdentityPostureData - responses: - '200': - $ref: '#/responses/getIdentityPostureData' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}/failed-service-requests': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieve a list of the most recent service failure requests due to posture checks - description: | - 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. - security: - - ztSession: [ ] - tags: - - Identity - operationId: getIdentityFailedServiceRequests - responses: - '200': - $ref: '#/responses/getIdentityFailedServiceRequest' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identities/{id}/mfa': - parameters: - - $ref: '#/parameters/id' - delete: - summary: Remove MFA from an identitity - description: | - Allows an admin to remove MFA enrollment from a specific identity. Requires admin. - security: - - ztSession: [ ] - tags: - - Identity - - MFA - operationId: removeIdentityMfa - responses: - '200': - $ref: '#/responses/emptyResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Identity-Types - ################################################################## - '/identity-types': - get: - summary: List available identity types - description: | - Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: listIdentityTypes - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listIdentityTypes' - '401': - $ref: '#/responses/unauthorizedResponse' - '/identity-types/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a identity type - description: Retrieves a single identity type by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Identity - operationId: detailIdentityType - responses: - '200': - $ref: '#/responses/detailIdentityType' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Service Edge Router Policies - ################################################################## - '/service-edge-router-policies': - get: - summary: List service edge router policies - description: | - Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: listServiceEdgeRouterPolicies - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listServiceEdgeRouterPolicies' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a service edge router policy resource - description: Create a service edge router policy resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: createServiceEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: A service edge router policy to create - schema: - $ref: '#/definitions/serviceEdgeRouterPolicyCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/service-edge-router-policies/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single service edge policy - description: Retrieves a single service edge policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: detailServiceEdgeRouterPolicy - responses: - '200': - $ref: '#/responses/detailServiceEdgePolicy' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a service edge policy - description: Update all fields on a service edge policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: updateServiceEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: A service edge router policy update object - schema: - $ref: '#/definitions/serviceEdgeRouterPolicyUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a service edge policy - description: Update the supplied fields on a service edge policy. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: patchServiceEdgeRouterPolicy - parameters: - - name: policy - in: body - required: true - description: A service edge router policy patch object - schema: - $ref: '#/definitions/serviceEdgeRouterPolicyPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a service edge policy - description: Delete a service edge policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: deleteServiceEdgeRouterPolicy - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/service-edge-router-policies/{id}/edge-routers': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the edge routers that a service edge router policy applies to - description: List the edge routers that a service edge router policy applies to - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: listServiceEdgeRouterPolicyEdgeRouters - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/service-edge-router-policies/{id}/services': - parameters: - - $ref: '#/parameters/id' - get: - summary: List the services that a service edge router policy applies to - description: List the services that a service edge router policy applies to - security: - - ztSession: [ ] - tags: - - Service Edge Router Policy - operationId: listServiceEdgeRouterPolicyServices - responses: - '200': - $ref: '#/responses/listServices' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Service Policies - ################################################################## - '/service-policies': - get: - summary: List service policies - description: | - Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: listServicePolicies - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listServicePolicies' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a service policy resource - description: Create a service policy resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: createServicePolicy - parameters: - - name: policy - in: body - required: true - description: A service policy to create - schema: - $ref: '#/definitions/servicePolicyCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/service-policies/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single service policy - description: Retrieves a single service policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: detailServicePolicy - responses: - '200': - $ref: '#/responses/detailServicePolicy' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a service policy - description: Update all fields on a service policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: updateServicePolicy - parameters: - - name: policy - in: body - required: true - description: A service policy update object - schema: - $ref: '#/definitions/servicePolicyUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a service policy - description: Update the supplied fields on a service policy. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: patchServicePolicy - parameters: - - name: policy - in: body - required: true - description: A service policy patch object - schema: - $ref: '#/definitions/servicePolicyPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a service policy - description: Delete a service policy by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: deleteServicePolicy - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/service-policies/{id}/identities': - parameters: - - $ref: '#/parameters/id' - get: - summary: List identities a service policy affects - description: | - Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: listServicePolicyIdentities - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listIdentities' - '401': - $ref: '#/responses/unauthorizedResponse' - '400': - $ref: '#/responses/notFoundResponse' - '/service-policies/{id}/services': - parameters: - - $ref: '#/parameters/id' - get: - summary: List services a service policy affects - description: | - Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: listServicePolicyServices - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listServices' - '401': - $ref: '#/responses/unauthorizedResponse' - '400': - $ref: '#/responses/notFoundResponse' - '/service-policies/{id}/posture-checks': - parameters: - - $ref: '#/parameters/id' - get: - summary: List posture check a service policy includes - description: | - Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service Policy - operationId: listServicePolicyPostureChecks - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listPostureChecks' - '401': - $ref: '#/responses/unauthorizedResponse' - '400': - $ref: '#/responses/notFoundResponse' - ################################################################### - # Services - ################################################################## - '/services': - get: - summary: List services - description: | - Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServices - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - - $ref: '#/parameters/roleFilter' - - $ref: '#/parameters/roleSemantic' - responses: - '200': - $ref: '#/responses/listServices' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a services resource - description: Create a services resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: createService - parameters: - - name: service - in: body - required: true - description: A service to create - schema: - $ref: '#/definitions/serviceCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/services/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single service - description: Retrieves a single service by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: detailService - responses: - '200': - $ref: '#/responses/detailService' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a service - description: Update all fields on a service by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: updateService - parameters: - - name: service - in: body - required: true - description: A service update object - schema: - $ref: '#/definitions/serviceUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a service - description: Update the supplied fields on a service. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: patchService - parameters: - - name: service - in: body - required: true - description: A service patch object - schema: - $ref: '#/definitions/servicePatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a service - description: Delete a service by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: deleteService - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/services/{id}/configs': - parameters: - - $ref: '#/parameters/id' - get: - summary: List configs associated to a specific service - description: | - Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceConfig - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listConfigs' - '401': - $ref: '#/responses/unauthorizedResponse' - '/services/{id}/service-edge-router-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List service edge router policies that affect a specific service - description: | - Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceServiceEdgeRouterPolicies - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listServiceEdgeRouterPolicies' - '401': - $ref: '#/responses/unauthorizedResponse' - '/services/{id}/service-policies': - parameters: - - $ref: '#/parameters/id' - get: - summary: List service policies that affect a specific service - description: | - Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceServicePolicies - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listServicePolicies' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/services/{id}/identities': - parameters: - - $ref: '#/parameters/id' - get: - summary: List identities with access - description: | - Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceIdentities - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listIdentities' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/services/{id}/edge-routers': - parameters: - - $ref: '#/parameters/id' - get: - summary: List accessible edge-routers - description: | - Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceEdgeRouters - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listEdgeRouters' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/services/{id}/terminators': - parameters: - - $ref: '#/parameters/id' - get: - summary: List of terminators assigned to a service - description: | - Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. - security: - - ztSession: [ ] - tags: - - Service - operationId: listServiceTerminators - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listTerminators' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Sessions - ################################################################## - '/sessions': - get: - summary: List sessions - description: | - 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. - security: - - ztSession: [ ] - tags: - - Session - operationId: listSessions - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listSessions' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a session resource - description: Create a session resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Session - operationId: createSession - parameters: - - name: session - in: body - required: true - description: A session to create - schema: - $ref: '#/definitions/sessionCreate' - responses: - '201': - $ref: '#/responses/sessionCreateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/sessions/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single session - description: Retrieves a single session by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Session - operationId: detailSession - responses: - '200': - $ref: '#/responses/detailSession' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a session - description: Delete a session by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Session - operationId: deleteSession - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - '/sessions/{id}/route-path': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single session's router path - description: Retrieves a single session's route path by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Session - operationId: detailSessionRoutePath - responses: - '200': - $ref: '#/responses/detailSessionRoutePath' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Terminators - ################################################################## - '/terminators': - get: - summary: List terminators - description: | - Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: listTerminators - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listTerminators' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a terminator resource - description: Create a terminator resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: createTerminator - parameters: - - name: terminator - in: body - required: true - description: A terminator to create - schema: - $ref: '#/definitions/terminatorCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/terminators/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single terminator - description: Retrieves a single terminator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: detailTerminator - responses: - '200': - $ref: '#/responses/detailTerminator' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a terminator - description: Update all fields on a terminator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: updateTerminator - parameters: - - name: terminator - in: body - required: true - description: A terminator update object - schema: - $ref: '#/definitions/terminatorUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a terminator - description: Update the supplied fields on a terminator. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: patchTerminator - parameters: - - name: terminator - in: body - required: true - description: A terminator patch object - schema: - $ref: '#/definitions/terminatorPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a terminator - description: Delete a terminator by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Terminator - operationId: deleteTerminator - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - - ################################################################### - # List Role Attributes in Use - ################################################################## - '/edge-router-role-attributes': - get: - summary: List role attributes in use by edge routers - description: | - Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Role Attributes - operationId: listEdgeRouterRoleAttributes - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listRoleAttributes' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/identity-role-attributes': - get: - summary: List role attributes in use by identities - description: | - Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Role Attributes - operationId: listIdentityRoleAttributes - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listRoleAttributes' - '401': - $ref: '#/responses/unauthorizedResponse' - - '/service-role-attributes': - get: - summary: List role attributes in use by services - description: | - Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Role Attributes - operationId: listServiceRoleAttributes - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listRoleAttributes' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Transit Routers - ################################################################## - '/transit-routers': - get: - summary: List transit routers - description: | - Retrieves a list of transit router resources; supports filtering, sorting, and pagination. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: listTransitRouters - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listTransitRouters' - '401': - $ref: '#/responses/unauthorizedResponse' - post: - summary: Create a transit router resource - description: Create a transit router resource. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: createTransitRouter - parameters: - - name: router - in: body - required: true - description: A transit router to create - schema: - $ref: '#/definitions/transitRouterCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/transit-routers/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single transit router - description: Retrieves a single transit router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: detailTransitRouter - responses: - '200': - $ref: '#/responses/detailTransitRouter' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a transit router - description: Update all fields on a transit router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: updateTransitRouter - parameters: - - name: router - in: body - required: true - description: A transit router update object - schema: - $ref: '#/definitions/transitRouterUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a transit router - description: Update the supplied fields on a transit router. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: patchTransitRouter - parameters: - - name: router - in: body - required: true - description: A transit router patch object - schema: - $ref: '#/definitions/transitRouterPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Delete a transit router - description: Delete a transit router by id. Requires admin access. - security: - - ztSession: [ ] - tags: - - Transit Router - operationId: deleteTransitRouter - responses: - '200': - $ref: '#/responses/deleteResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '409': - $ref: '#/responses/cannotDeleteReferencedResourceResponse' - - ################################################################### - # Database - ################################################################## - '/database/snapshot': - post: - summary: Create a new database snapshot - description: Create a new database snapshot. Requires admin access. - security: - - ztSession: [ ] - tags: - - Database - operationId: createDatabaseSnapshot - responses: - '200': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '429': - $ref: '#/responses/rateLimitedResponse' - /database/check-data-integrity: - post: - summary: Starts a data integrity scan on the datastore - description: Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity. - security: - - ztSession: [ ] - tags: - - Database - operationId: checkDataIntegrity - responses: - '202': - $ref: '#/responses/emptyResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '429': - $ref: '#/responses/rateLimitedResponse' - /database/fix-data-integrity: - post: - summary: Runs a data integrity scan on the datastore, attempts to fix any issues it can and returns any found issues - 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. - security: - - ztSession: [ ] - tags: - - Database - operationId: fixDataIntegrity - responses: - '202': - $ref: '#/responses/emptyResponse' - '429': - $ref: '#/responses/rateLimitedResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - /database/data-integrity-results: - get: - summary: Returns any results found from in-progress integrity checks - description: Returns any results found from in-progress integrity checks. Requires admin access. - security: - - ztSession: [ ] - tags: - - Database - operationId: dataIntegrityResults - responses: - '200': - $ref: '#/responses/dataIntegrityCheckResult' - '401': - $ref: '#/responses/unauthorizedResponse' - - ################################################################### - # Posture Check Types - ################################################################## - '/posture-check-types': - get: - summary: List a subset of posture check types - description: | - Retrieves a list of posture check types - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: listPostureCheckTypes - produces: - - application/json; charset=utf-8 - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - responses: - '200': - $ref: '#/responses/listPostureCheckTypes' - '/posture-check-types/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single posture check type - description: Retrieves a single posture check type by id - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: detailPostureCheckType - responses: - '200': - $ref: '#/responses/detailPostureCheckType' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Posture Response - ################################################################## - '/posture-response': - post: - summary: Submit a posture response to a posture query - description: Submits posture responses - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: createPostureResponse - parameters: - - name: postureResponse - in: body - required: true - description: A Posture Response - schema: - $ref: '#/definitions/PostureResponseCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/posture-response-bulk': - post: - summary: Submit multiple posture responses - description: Submits posture responses - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: createPostureResponseBulk - parameters: - - name: postureResponse - in: body - required: true - description: A Posture Response - schema: - # using a named array definition causes issues w/ code gen - type: array - items: - $ref: "#/definitions/PostureResponseCreate" - responses: - '200': - $ref: '#/responses/emptyResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - ################################################################### - # Posture Checks - ################################################################## - '/posture-checks': - get: - summary: List a subset of posture checks - description: | - Retrieves a list of posture checks - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: listPostureChecks - produces: - - application/json; charset=utf-8 - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/filter' - - $ref: '#/parameters/roleFilter' - - $ref: '#/parameters/roleSemantic' - responses: - '200': - $ref: '#/responses/listPostureChecks' - post: - summary: Creates a Posture Checks - description: Creates a Posture Checks - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: createPostureCheck - parameters: - - name: postureCheck - in: body - required: true - description: A Posture Check to create - schema: - $ref: '#/definitions/PostureCheckCreate' - responses: - '201': - $ref: '#/responses/createResponse' - '400': - $ref: '#/responses/badRequestResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - '/posture-checks/{id}': - parameters: - - $ref: '#/parameters/id' - get: - summary: Retrieves a single Posture Checks - description: Retrieves a single Posture Checks by id - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: detailPostureCheck - responses: - '200': - $ref: '#/responses/detailPostureCheck' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - put: - summary: Update all fields on a Posture Checks - description: Update all fields on a Posture Checks by id - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: updatePostureCheck - parameters: - - name: postureCheck - in: body - required: true - description: A Posture Check update object - schema: - $ref: '#/definitions/PostureCheckUpdate' - responses: - '200': - $ref: '#/responses/updateResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - patch: - summary: Update the supplied fields on a Posture Checks - description: Update only the supplied fields on a Posture Checks by id - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: patchPostureCheck - parameters: - - name: postureCheck - in: body - required: true - description: A Posture Check patch object - schema: - $ref: '#/definitions/PostureCheckPatch' - responses: - '200': - $ref: '#/responses/patchResponse' - '400': - $ref: '#/responses/badRequestResponse' - '404': - $ref: '#/responses/notFoundResponse' - '401': - $ref: '#/responses/unauthorizedResponse' - delete: - summary: Deletes an Posture Checks - description: Deletes and Posture Checks by id - security: - - ztSession: [ ] - tags: - - Posture Checks - operationId: deletePostureCheck - responses: - '200': - $ref: '#/responses/deleteResponse' - '404': - $ref: '#/responses/notFoundResponse' - '403': - $ref: '#/responses/unauthorizedResponse' - -####################################################################################################################### -# -# Parameters - Reusable parameters -# -####################################################################################################################### -parameters: - id: - name: id - required: true - type: string - in: path - description: The id of the requested resource - serviceId: - name: serviceId - required: true - type: string - in: path - description: The id of a service - limit: - name: limit - type: integer - in: query - offset: - name: offset - type: integer - in: query - filter: - name: filter - type: string - in: query - token: - name: token - type: string - format: uuid - in: query - required: true - token-optional: - name: token - type: string - format: uuid - in: query - authMethod: - name: method - in: query - required: true - type: string - enum: - - password - - cert - roleFilter: - name: roleFilter - type: array - in: query - collectionFormat: multi - items: - type: string - roleSemantic: - name: roleSemantic - type: string - in: query - -####################################################################################################################### -# -# Responses - Envelope Wrapped Definitions -# -####################################################################################################################### -responses: - ################################################################### - # Errors - ################################################################## - badRequestResponse: - 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: - field: '(root)' - type: required - value: - fooField: abc - fooField2: def - message: '(root): fooField3 is required' - details: - context: '(root)' - field: '(root)' - property: fooField3 - causeMessage: schema validation failed - code: COULD_NOT_VALIDATE - message: The supplied request contains an invalid document - requestId: ac6766d6-3a09-44b3-8d8a-1b541d97fdd9 - meta: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - unauthorizedResponse: - description: The currently supplied session does not have the correct access rights to request this resource - schema: - $ref: '#/definitions/apiErrorEnvelope' - examples: - 'application/json': - error: - args: - urlVars: { } - cause: '' - causeMessage: '' - code: UNAUTHORIZED - message: The request could not be completed. The session is not authorized or the - credentials are invalid - requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f - meta: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - invalidAuthResponse: - 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: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - notFoundResponse: - description: The requested resource does not exist - schema: - $ref: '#/definitions/apiErrorEnvelope' - examples: - 'application/json': - error: - args: - urlVars: - id: 71a3000f-7dda-491a-9b90-a19f4ee6c406 - cause: - causeMessage: '' - code: NOT_FOUND - message: The resource requested was not found or is no longer available - requestId: 270908d6-f2ef-4577-b973-67bec18ae376 - meta: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - alreadyMfaEnrolledResponse: - description: The identity is already enrolled in MFA - schema: - $ref: '#/definitions/apiErrorEnvelope' - examples: - 'application/json': - error: - args: - cause: - causeMessage: '' - code: ALREADY_MFA_ENROLLED - message: The identity is already enrolled in MFA - requestId: 270908d6-f2ef-4577-b973-67bec18ae376 - meta: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - cannotDeleteReferencedResourceResponse: - 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: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - rateLimitedResponse: - 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: - apiEnrolmentVersion: 0.0.1 - apiVersion: 0.0.1 - ################################################################### - # Standard Responses - ################################################################## - emptyResponse: - description: Base empty response - schema: - $ref: '#/definitions/empty' - deleteResponse: - description: The delete request was successful and the resource has been removed - schema: - $ref: '#/definitions/empty' - updateResponse: - description: The update request was successful and the resource has been altered - schema: - $ref: '#/definitions/empty' - patchResponse: - description: The patch request was successful and the resource has been altered - schema: - $ref: '#/definitions/empty' - createResponse: - description: The create request was successful and the resource has been added at the following location - schema: - $ref: '#/definitions/createEnvelope' - sessionCreateResponse: - description: The create request was successful and the resource has been added at the following location - schema: - $ref: '#/definitions/sessionCreateEnvelope' - - ################################################################### - # Current Session - ################################################################## - detailCurrentAPISession: - description: The API session associated with the session used to issue the request - schema: - $ref: '#/definitions/currentAPISessionDetailEnvelope' - examples: - default: - meta: { } - data: - id: 27343114-b44f-406e-9981-f3c4f2f28d54 - createdAt: '2020-03-09T19:03:49.1883693Z' - updatedAt: '2020-03-09T19:04:21.5600897Z' - _links: - self: - href: './current-api-session' - tags: - - userField1: 123 - - userField2: asdf - token: 28bb0ed2-0577-4632-ae70-d17106b92871 - identity: - urlName: identities - id: 66352d7b-a6b2-4ce9-85bb-9f18e318704d - name: Default Admin - _links: - self: - href: './identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d' - expiresAt: '2020-03-09T19:34:21.5600897Z' - configTypes: [ ] - - #################################################################### - # Current API Session: Certificates - ################################################################## - listCurrentApiSessionCertificates: - description: A list of the current API Session's certificate - schema: - $ref: '#/definitions/listCurrentAPISessionCertificatesEnvelope' - createCurrentApiSessionCertificateResponse: - description: A response of a create API Session certificate - schema: - $ref: '#/definitions/createCurrentApiSessionCertificateEnvelope' - detailCurrentApiSessionCertificate: - description: A response containing a single API Session certificate - schema: - $ref: '#/definitions/detailCurrentApiSessionCertificateEnvelope' - - ################################################################### - # Current Identity - ################################################################## - detailCurrentIdentity: - description: The identity associated with the API Session used to issue the request - schema: - $ref: '#/definitions/currentIdentityDetailEnvelope' - examples: - default: - meta: { } - data: - id: 66352d7b-a6b2-4ce9-85bb-9f18e318704d - createdAt: '2020-01-13T16:38:13.6854788Z' - updatedAt: '2020-01-13T16:38:13.6854788Z' - _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' - tags: { } - name: Default Admin - type: - urlName: identity-types - id: User - name: User - _links: - self: - href: './identity-types/User' - isDefaultAdmin: true - isAdmin: true - authenticators: - updb: - username: admin - enrollment: { } - roleAttributes: - $ref: '#/definitions/attributes' - - ################################################################### - # Current Identity: MFA - ################################################################## - mfaCreatedResponse: - description: The create request was succesful and the response contains the location and details to complete MFA enrollment - schema: - $ref: '#/definitions/mfaCreatedEnvelope' - - detailMfa: - description: The details of an MFA enrollment - schema: - $ref: '#/definitions/detailMfaEnvelope' - - detailMfaRecoveryCodes: - description: The recovery codes of an MFA enrollment - schema: - $ref: '#/definitions/detailMfaRecoveryCodesEnvelope' - - ################################################################### - # API Session - ################################################################## - listAPISessions: - description: A list of active API Sessions - schema: - $ref: '#/definitions/listAPISessionsEnvelope' - detailAPISession: - description: Retrieves a singular API Session by id - schema: - $ref: '#/definitions/detailAPISessionEnvelope' - - ################################################################### - # Authenticators - ################################################################## - listAuthenticators: - description: A list of authenticators - schema: - $ref: '#/definitions/listAuthenticatorsEnvelope' - detailAuthenticator: - description: A singular authenticator resource - schema: - $ref: '#/definitions/detailAuthenticatorEnvelope' - ################################################################### - # Certificate Authority - ################################################################## - listCas: - description: A list of Certificate Authorities (CAs) - schema: - $ref: '#/definitions/listCasEnvelope' - detailCa: - description: A singular Certificate Authority (CA) resource - schema: - $ref: '#/definitions/detailCaEnvelope' - ################################################################### - # Config-Types - ################################################################## - listConfigTypes: - description: A list of config-types - schema: - $ref: '#/definitions/listConfigTypesEnvelope' - detailConfigType: - description: A singular config-type resource - schema: - $ref: '#/definitions/detailConfigTypeEnvelope' - ################################################################### - # Configs - ################################################################## - listConfigs: - description: A list of configs - schema: - $ref: '#/definitions/listConfigsEnvelope' - detailConfig: - description: A singular config resource - schema: - $ref: '#/definitions/detailConfigEnvelope' - ################################################################### - # Informational - ################################################################## - listVersion: - description: Version information for the controller - schema: - $ref: '#/definitions/listVersionEnvelope' - listSummaryCounts: - description: Entity counts scopped to the current identitie's access - schema: - $ref: '#/definitions/listSummaryCountsEnvelope' - listProtocols: - description: A list of supported Edge protocols - schema: - $ref: '#/definitions/listProtocolsEnvelope' - ################################################################### - # Enrollments - ################################################################## - listEnrollments: - description: A list of enrollments - schema: - $ref: '#/definitions/listEnrollmentsEnvelope' - detailEnrollment: - description: A singular enrollment resource - schema: - $ref: '#/definitions/detailEnrollmentEnvelope' - zitiSignedCert: - description: A PEM encoded certificate signed by the internal Ziti CA - schema: - type: string - examples: - application/x-x509-user-cert: | - -----BEGIN CERTIFICATE----- - MIICzDCCAlGgAwIBAgIRAPkVg1jVKqnNGFpSB3lPbaIwCgYIKoZIzj0EAwIwXjEL - MAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0w - KwYDVQQDDCROZXRGb3VuZHJ5IFppdGkgRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwHhcN - MTgxMTE1MTI1NzE3WhcNMTkxMTI1MTI1NzE3WjBrMQswCQYDVQQGEwJVUzELMAkG - A1UECAwCTkMxEjAQBgNVBAcMCUNoYXJsb3R0ZTETMBEGA1UECgwKTmV0Rm91bmRy - eTEPMA0GA1UECwwGQWR2RGV2MRUwEwYDVQQDDAxaaXRpQ2xpZW50MDEwdjAQBgcq - hkjOPQIBBgUrgQQAIgNiAATTl2ft+/K9RvDgki9gSr9udNcV2bxD4LrWEdCdXNzF - iVUiEcEte9z/M0JRt8lgo17OjFvS+ecrAmLtIZNmQnH3+9YeafjeNPpvQsMKxlTN - MnU7Hka11GHc6swQZSyHvlKjgcUwgcIwCQYDVR0TBAIwADARBglghkgBhvhCAQEE - BAMCBaAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2VuZXJhdGVkIENsaWVudCBD - ZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUtx+Tej6lSYdjb8Jbc2QuvoEsI/swHwYDVR0j - BBgwFoAUcdTlRrnP43ZbQ3PGAbZMPE26+H4wDgYDVR0PAQH/BAQDAgXgMB0GA1Ud - JQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAKBggqhkjOPQQDAgNpADBmAjEAuXDS - H7KKMr+la+Yuh8d8Q9cLtXzdS0j6a8e7iOyPJmdWq2WuzNdbCfAfLgKXuxhSAjEA - sadZrXl1OBv11RGAKdYBIyRmfYUotCFAtCNKcfgBUxci0TDaKDA7r3jnjKT1d7Fs - -----END CERTIFICATE----- - erottResponse: - description: A response containing the edge routers signed certificates (server chain, server cert, CAs). - schema: - $ref: '#/definitions/enrollmentCertsEnvelope' - routerExtendEnrollmentResponse: - description: A response containg the edge routers new signed certificates (server chain, server cert, CAs). - schema: - $ref: '#/definitions/enrollmentCertsEnvelope' - ################################################################### - # Edge Routers - ################################################################## - listEdgeRouters: - description: A list of edge routers - schema: - $ref: '#/definitions/listEdgeRoutersEnvelope' - detailEdgeRouter: - description: A singular edge router resource - schema: - $ref: '#/definitions/detailedEdgeRouterEnvelope' - - listCurrentIdentityEdgeRouters: - description: A list of edge routers - schema: - $ref: '#/definitions/listCurrentIdentityEdgeRoutersEnvelope' - ################################################################### - # Edge Router Policies - ################################################################## - listEdgeRouterPolicies: - description: A list of edge router policies - schema: - $ref: '#/definitions/listEdgeRouterPoliciesEnvelope' - detailEdgeRouterPolicy: - description: A single edge router policy - schema: - $ref: '#/definitions/detailEdgeRouterPolicyEnvelope' - - ################################################################### - # Service Policies - ################################################################## - listServicePolicies: - description: A list of service policies - schema: - $ref: '#/definitions/listServicePoliciesEnvelope' - detailServicePolicy: - description: A single service policy - schema: - $ref: '#/definitions/detailServicePolicyEnvelop' - ################################################################### - # Services - ################################################################## - listServices: - description: A list of services - schema: - $ref: '#/definitions/listServicesEnvelope' - detailService: - description: A single service - schema: - $ref: '#/definitions/detailServiceEnvelope' - ################################################################### - # Identities - ################################################################## - listIdentities: - description: A list of identities - schema: - $ref: '#/definitions/listIdentitiesEnvelope' - detailIdentity: - description: A signle identity - schema: - $ref: '#/definitions/detailIdentityEnvelope' - ################################################################### - # Geo Regions - ################################################################## - listGeoRegions: - description: A list of geo-regions - schema: - $ref: '#/definitions/listGeoRegionsEnvelope' - detailGeoRegion: - description: A single geo-region - schema: - $ref: '#/definitions/detailGeoRegionEnvelope' - ################################################################### - # Identity-Types - ################################################################## - listIdentityTypes: - description: A list of identity types - schema: - $ref: '#/definitions/listIdentityTypesEnvelope' - detailIdentityType: - description: A single identity type - schema: - $ref: '#/definitions/detailIdentityTypeEnvelope' - ################################################################### - # Service Configs - ################################################################## - listServiceConfigs: - description: A list of service configs - schema: - $ref: '#/definitions/listServiceConfigsEnvelope' - ################################################################### - # Service Edge Router Policies - ################################################################## - listServiceEdgeRouterPolicies: - description: A list of service edge router policies - schema: - $ref: '#/definitions/listServiceEdgeRouterPoliciesEnvelope' - detailServiceEdgePolicy: - description: A single service edge router policy - schema: - $ref: '#/definitions/detailServiceEdgePolicyEnvelope' - ################################################################### - # Sessions - ################################################################## - listSessions: - description: A list of sessions - schema: - $ref: '#/definitions/listSessionsEnvelope' - detailSession: - description: A single session - schema: - $ref: '#/definitions/detailSessionEnvelope' - detailSessionRoutePath: - description: A single session's route path - schema: - $ref: '#/definitions/detailSessionRoutePathEnvelope' - ################################################################### - # Terminators - ################################################################## - listTerminators: - description: A list of terminators - schema: - $ref: '#/definitions/listTerminatorsEnvelope' - detailTerminator: - description: A single terminator - schema: - $ref: '#/definitions/detailTerminatorEnvelope' - ################################################################### - # Specs - ################################################################## - listSpecs: - description: A list of specifications - schema: - $ref: '#/definitions/listSpecsEnvelope' - detailSpec: - description: A single specification - schema: - $ref: '#/definitions/detailSpecEnvelope' - detailSpecBody: - description: Returns the document that represents the specification - schema: - $ref: '#/definitions/detailSpecBodyEnvelope' - ################################################################### - # Role Attributes - ################################################################## - listRoleAttributes: - description: A list of role attributes - schema: - $ref: '#/definitions/listRoleAttributesEnvelope' - - ################################################################### - # Policy Advisor - ################################################################## - getIdentityPolicyAdvice: - description: Returns the document that represents the policy advice - schema: - $ref: '#/definitions/getIdentityPolicyAdviceEnvelope' - - ################################################################### - # Posture Data - ################################################################## - getIdentityPostureData: - description: Returns the document that represents posture data - schema: - $ref: '#/definitions/getIdentityPostureDataEnvelope' - getIdentityFailedServiceRequest: - description: Returns a list of service request failures - schema: - $ref: '#/definitions/getIdentityFailedServiceRequestEnvelope' - ################################################################### - # Transit Routers - ################################################################## - listTransitRouters: - description: A list of specifications - schema: - $ref: '#/definitions/listTransitRoutersEnvelope' - detailTransitRouter: - description: A single transit router - schema: - $ref: '#/definitions/detailTransitRouterEnvelope' - - ################################################################### - # Datastore - ################################################################## - dataIntegrityCheckResult: - description: A list of data integrity issues found - schema: - $ref: '#/definitions/dataIntegrityCheckResultEnvelope' - - ################################################################### - # Posture Check Types - ################################################################## - listPostureCheckTypes: - description: A list of posture check types - schema: - $ref: '#/definitions/listPostureCheckTypesEnvelope' - detailPostureCheckType: - description: Retrieves a singular posture check type by id - schema: - $ref: '#/definitions/detailPostureCheckTypeEnvelope' - - ################################################################### - # Posture Check - ################################################################## - listPostureChecks: - description: A list of posture checks - schema: - $ref: '#/definitions/listPostureCheckEnvelope' - detailPostureCheck: - description: Retrieves a singular posture check by id - schema: - $ref: '#/definitions/detailPostureCheckEnvelope' - ################################################################### - # List Service Updates - ################################################################## - listCurrentApiSessionServiceUpdates: - description: Data indicating necessary service updates - schema: - $ref: '#/definitions/listCurrentApiSessionServiceUpdatesEnvelope' - -####################################################################################################################### -# -# Definitions - In & Out Models Only -# -####################################################################################################################### -definitions: - ################################################################### - # Shared Definitions - ################################################################## - baseEntity: - description: Fields shared by all Edge API entities - type: object - required: - - id - - createdAt - - updatedAt - - _links - - tags - properties: - id: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - _links: - $ref: '#/definitions/links' - tags: - $ref: '#/definitions/tags' - link: - description: A link to another resource - type: object - required: - - href - properties: - href: - type: string - format: uri - method: - type: string - comment: - type: string - links: - description: A map of named links - type: object - x-omitempty: false - additionalProperties: - $ref: '#/definitions/link' - entityRef: - description: A reference to another resource and links to interact with it - type: object - properties: - entity: - type: string - id: - type: string - name: - type: string - _links: - $ref: '#/definitions/links' - tags: - description: 'A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean' - type: object - x-omitempty: false - additionalProperties: { - type: object - } - attributes: - description: A set of strings used to loosly couple this resource to policies - type: array - x-omitempty: false - items: - type: string - roles: - type: array - x-omitempty: false - items: - type: string - namedRole: - type: object - properties: - role: - type: string - name: - type: string - namedRoles: - type: array - x-omitempty: false - items: - $ref: '#/definitions/namedRole' - semantic: - type: string - enum: - - AllOf - - AnyOf - dialBind: - type: string - enum: - - Dial - - Bind - dialBindArray: - type: array - items: - $ref: '#/definitions/dialBind' - versionInfo: - type: object - required: - - os - - version - - arch - - buildDate - - revision - properties: - os: - type: string - version: - type: string - arch: - type: string - buildDate: - type: string - revision: - type: string - osType: - type: string - enum: - - Windows - - WindowsServer - - Android - - iOS - - Linux - - macOS - operatingSystem: - type: object - required: - - type - - versions - properties: - type: - $ref: '#/definitions/osType' - versions: - type: array - items: - type: string - process: - type: object - required: - - osType - - path - properties: - osType: - $ref: '#/definitions/osType' - path: - type: string - hashes: - type: array - items: - type: string - signerFingerprint: - type: string - processMulti: - type: object - required: - - osType - - path - properties: - osType: - $ref: '#/definitions/osType' - path: - type: string - hashes: - type: array - items: - type: string - signerFingerprints: - type: array - items: - type: string - postureCheckType: - type: string - enum: - - OS - - PROCESS - - PROCESS_MULTI - - DOMAIN - - MAC - - MFA - ################################################################### - # Authentication - ################################################################## - password: - type: string - minLength: 5 - maxLength: 100 - password-nullable: - type: string - minLength: 5 - maxLength: 100 - x-nullable: true - username: - type: string - minLength: 4 - maxLength: 100 - username-nullable: - type: string - minLength: 4 - maxLength: 100 - x-nullable: true - authenticate: - type: object - description: A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method. - properties: - username: - $ref: '#/definitions/username' - password: - $ref: '#/definitions/password' - envInfo: - $ref: '#/definitions/envInfo' - sdkInfo: - $ref: '#/definitions/sdkInfo' - configTypes: - $ref: '#/definitions/configTypes' - ################################################################### - # Current Session - ################################################################## - apiSessionList: - type: array - items: - $ref: '#/definitions/apiSessionDetail' - apiSessionDetail: - description: An API Session object - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - token - - identity - - identityId - - configTypes - - ipAddress - - authQueries - - cachedUpdatedAt - - isMfaRequired - - isMfaComplete - properties: - token: - type: string - identity: - $ref: '#/definitions/entityRef' - identityId: - type: string - ipAddress: - type: string - configTypes: - type: array - items: - type: string - authQueries: - $ref: '#/definitions/authQueryList' - isMfaRequired: - type: boolean - isMfaComplete: - type: boolean - lastActivityAt: - type: string - format: date-time - cachedLastActivityAt: - type: string - format: date-time - - - currentApiSessionDetail: - description: An API Session object for the current API session - type: object - allOf: - - $ref: '#/definitions/apiSessionDetail' - - type: object - required: - - expiresAt - - expirationSeconds - properties: - expiresAt: - type: string - format: date-time - expirationSeconds: - type: integer - ################################################################### - # Identities - ################################################################## - identityType: - type: string - enum: - - User - - Device - - Service - - Router - identityCreate: - description: An identity to create - type: object - required: - - name - - type - - isAdmin - properties: - name: - type: string - type: - $ref: '#/definitions/identityType' - isAdmin: - type: boolean - enrollment: - type: object - properties: - ott: - type: boolean - updb: - type: string - ottca: - type: string - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - defaultHostingPrecedence: - $ref: '#/definitions/terminatorPrecedence' - defaultHostingCost: - $ref: '#/definitions/terminatorCost' - serviceHostingPrecedences: - $ref: '#/definitions/terminatorPrecedenceMap' - serviceHostingCosts: - $ref: '#/definitions/terminatorCostMap' - appData: - $ref: '#/definitions/tags' - - identityUpdate: - type: object - required: - - type - - name - - isAdmin - properties: - name: - type: string - type: - $ref: '#/definitions/identityType' - isAdmin: - type: boolean - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - defaultHostingPrecedence: - $ref: '#/definitions/terminatorPrecedence' - defaultHostingCost: - $ref: '#/definitions/terminatorCost' - serviceHostingPrecedences: - $ref: '#/definitions/terminatorPrecedenceMap' - serviceHostingCosts: - $ref: '#/definitions/terminatorCostMap' - appData: - $ref: '#/definitions/tags' - - identityPatch: - type: object - properties: - name: - type: string - type: - $ref: '#/definitions/identityType' - isAdmin: - type: boolean - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - defaultHostingPrecedence: - $ref: '#/definitions/terminatorPrecedence' - defaultHostingCost: - $ref: '#/definitions/terminatorCost' - serviceHostingPrecedences: - $ref: '#/definitions/terminatorPrecedenceMap' - serviceHostingCosts: - $ref: '#/definitions/terminatorCostMap' - appData: - $ref: '#/definitions/tags' - - identityList: - description: A list of identities - type: array - items: - $ref: '#/definitions/identityDetail' - 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 - properties: - name: - type: string - type: - $ref: '#/definitions/entityRef' - typeId: - type: string - isDefaultAdmin: - type: boolean - isAdmin: - type: boolean - authenticators: - $ref: '#/definitions/identityAuthenticators' - enrollment: - $ref: '#/definitions/identityEnrollments' - envInfo: - $ref: '#/definitions/envInfo' - sdkInfo: - $ref: '#/definitions/sdkInfo' - roleAttributes: - $ref: '#/definitions/attributes' - hasEdgeRouterConnection: - type: boolean - hasApiSession: - type: boolean - isMfaEnabled: - type: boolean - defaultHostingPrecedence: - $ref: '#/definitions/terminatorPrecedence' - defaultHostingCost: - $ref: '#/definitions/terminatorCost' - serviceHostingPrecedences: - $ref: '#/definitions/terminatorPrecedenceMap' - serviceHostingCosts: - $ref: '#/definitions/terminatorCostMap' - appData: - $ref: '#/definitions/tags' - - identityAuthenticators: - type: object - properties: - updb: - properties: - username: - type: string - type: object - cert: - type: object - properties: - fingerprint: - type: string - identityEnrollments: - type: object - properties: - updb: - type: object - properties: - id: - type: string - token: - type: string - jwt: - type: string - expiresAt: - type: string - format: date-time - ott: - type: object - properties: - id: - type: string - token: - type: string - jwt: - type: string - expiresAt: - type: string - format: date-time - ottca: - type: object - properties: - id: - type: string - token: - type: string - jwt: - type: string - caId: - type: string - ca: - $ref: '#/definitions/entityRef' - expiresAt: - type: string - format: date-time - ################################################################### - # Authenticator - ################################################################## - authenticatorCreate: - description: Creates an authenticator for a specific identity which can be used for API authentication - type: object - required: - - username - - password - - method - - identityId - properties: - username: - type: string - description: The username that the identity will login with. Used only for method='updb' - password: - type: string - description: The password the identity will login with, Used only for method='updb' - method: - type: string - description: The type of authenticator to create; which will dictate which properties on this object are required. - identityId: - type: string - description: The id of an existing identity that will be assigned this authenticator - tags: - $ref: '#/definitions/tags' - authenticatorList: - description: An array of authenticator resources - type: array - items: - $ref: '#/definitions/authenticatorDetail' - authenticatorDetail: - description: A singular authenticator resource - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - method - - identityId - - identity - properties: - method: - type: string - identityId: - type: string - identity: - $ref: '#/definitions/entityRef' - certPem: - type: string - fingerprint: - type: string - username: - type: string - authenticatorUpdate: - description: All of the fields on an authenticator that will be updated - type: object - required: - - username - - password - properties: - username: - $ref: '#/definitions/username' - password: - $ref: '#/definitions/password' - tags: - $ref: '#/definitions/tags' - authenticatorPatch: - description: All of the fields on an authenticator that may be updated - type: object - properties: - username: - $ref: '#/definitions/username-nullable' - password: - $ref: '#/definitions/password-nullable' - tags: - $ref: '#/definitions/tags' - 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' - 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' - ################################################################### - # Certificate Authorities - ################################################################## - caList: - description: An array of Certificate Authority (CA) resources - type: array - items: - $ref: '#/definitions/caDetail' - 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: - name: - type: string - fingerprint: - type: string - certPem: - type: string - isVerified: - type: boolean - example: false - verificationToken: - type: string - format: uuid - isAutoCaEnrollmentEnabled: - type: boolean - example: true - isOttCaEnrollmentEnabled: - type: boolean - example: true - isAuthEnabled: - type: boolean - example: true - identityRoles: - $ref: '#/definitions/roles' - identityNameFormat: - type: string - caCreate: - description: A create Certificate Authority (CA) object - type: object - required: - - name - - certPem - - isAutoCaEnrollmentEnabled - - isOttCaEnrollmentEnabled - - isAuthEnabled - - identityRoles - properties: - name: - type: string - example: 'Test 3rd Party External CA' - isAutoCaEnrollmentEnabled: - type: boolean - example: true - isAuthEnabled: - type: boolean - example: true - isOttCaEnrollmentEnabled: - type: boolean - example: true - 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-----' - identityRoles: - $ref: '#/definitions/roles' - identityNameFormat: - type: string - tags: - $ref: '#/definitions/tags' - caUpdate: - type: object - required: - - name - - isAutoCaEnrollmentEnabled - - isOttCaEnrollmentEnabled - - isAuthEnabled - - identityRoles - properties: - name: - type: string - example: My CA - isAutoCaEnrollmentEnabled: - type: boolean - example: true - isOttCaEnrollmentEnabled: - type: boolean - example: true - isAuthEnabled: - type: boolean - example: true - identityRoles: - $ref: '#/definitions/roles' - identityNameFormat: - type: string - tags: - $ref: '#/definitions/tags' - caPatch: - type: object - properties: - name: - type: string - example: My CA - isAutoCaEnrollmentEnabled: - type: boolean - example: true - isOttCaEnrollmentEnabled: - type: boolean - example: true - isAuthEnabled: - type: boolean - example: true - identityRoles: - $ref: '#/definitions/roles' - identityNameFormat: - type: string - tags: - $ref: '#/definitions/tags' - ################################################################### - # Config-Types - ################################################################## - configTypeList: - description: An array of config-type resources - type: array - items: - $ref: '#/definitions/configTypeDetail' - 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 - configTypeCreate: - type: object - description: A config-type create object - required: - - name - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: ziti-tunneler-server.v1 - schema: - description: A JSON schema to enforce configuration against - type: object - additionalProperties: true - configTypeUpdate: - description: A config-type update object - type: object - required: - - name - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: ziti-tunneler-server.v1 - schema: - description: A JSON schema to enforce configuration against - type: object - additionalProperties: true - configTypePatch: - description: A config-type patch object - type: object - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: ziti-tunneler-server.v1 - schema: - description: A JSON schema to enforce configuration against - type: object - additionalProperties: true - ################################################################### - # Configs - ################################################################## - configList: - description: An array of config resources - type: array - items: - $ref: '#/definitions/configDetail' - configDetail: - description: A config resource - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - configTypeId - - configType - - data - properties: - name: - type: string - configTypeId: - type: string - configType: - $ref: '#/definitions/entityRef' - data: - type: object - description: The data section of a config is based on the schema of its type - configCreate: - type: object - description: A config create object - required: - - name - - configTypeId - - data - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: default.ziti-tunneler-server.v1 - configTypeId: - type: string - description: The id of a config-type that the data section will match - data: - type: object - x-nullable: false - additionalProperties: true - description: Data payload is defined by the schema of the config-type defined in the type parameter - example: - name: test-config - configTypeId: cea49285-6c07-42cf-9f52-09a9b115c783 - data: - hostname: example.com - port: 80 - configUpdate: - type: object - description: A config update object - required: - - name - - data - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: default.ziti-tunneler-server.v1 - data: - type: object - x-nullable: false - additionalProperties: true - description: Data payload is defined by the schema of the config-type defined in the type parameter - example: - name: example-config-name - data: - hostname: example.com - port: 80 - configPatch: - type: object - description: A config patch object - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - example: default.ziti-tunneler-server.v1 - data: - type: object - additionalProperties: true - description: Data payload is defined by the schema of the config-type defined in the type parameter - example: - name: example-config-name - data: - hostname: example.com - port: 80 - ################################################################### - # Enrollments - ################################################################## - enrollmentDetail: - type: object - description: | - An enrollment object. Enrolments are tied to identities and portentially 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. - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - token - - method - - expiresAt - - details - properties: - token: - type: string - method: - type: string - expiresAt: - type: string - format: date-time - identityId: - type: string - identity: - $ref: '#/definitions/entityRef' - edgeRouterId: - type: string - edgeRouter: - $ref: '#/definitions/entityRef' - transitRouterId: - type: string - transitRouter: - $ref: '#/definitions/entityRef' - username: - type: string - details: - type: object - additionalProperties: - type: string - example: - id: 624fa53f-7629-4a7a-9e38-c1f4ce322c1d - createdAt: '0001-01-01T00:00:00Z' - updatedAt: '0001-01-01T00:00:00Z' - _links: - self: - href: './enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d' - tags: - token: 1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1 - method: updb - expiresAt: '2020-03-11T20:20:24.0055543Z' - identity: - urlName: identities - id: f047ac96-dc3a-408a-a6f2-0ba487c08ef9 - name: updb--0f245140-7f2e-4326-badf-6aba55e52475 - _links: - self: - href: './identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9' - ca: - username: example-username - enrollmentList: - description: An array of enrollment resources - type: array - items: - $ref: '#/definitions/enrollmentDetail' - ################################################################### - # Edge Routers - ################################################################## - edgeRouterCreate: - description: An edge router create object - type: object - required: - - name - properties: - name: - type: string - isTunnelerEnabled: - type: boolean - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - appData: - $ref: '#/definitions/tags' - - edgeRouterUpdate: - description: An edge router update object - type: object - required: - - name - properties: - name: - type: string - isTunnelerEnabled: - type: boolean - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - appData: - $ref: '#/definitions/tags' - - edgeRouterPatch: - description: An edge router patch object - type: object - properties: - name: - type: string - isTunnelerEnabled: - type: boolean - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - appData: - $ref: '#/definitions/tags' - currentIdentityEdgeRouterList: - description: A list of edge router resources - type: array - items: - $ref: '#/definitions/currentIdentityEdgeRouterDetail' - currentIdentityEdgeRouterDetail: - description: A detail edge router resource - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - $ref: '#/definitions/commonEdgeRouterProperties' - edgeRouterList: - description: A list of edge router resources - type: array - items: - $ref: '#/definitions/edgeRouterDetail' - 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: - isVerified: - type: boolean - enrollmentToken: - type: string - x-nullable: true - enrollmentJwt: - type: string - x-nullable: true - enrollmentCreatedAt: - type: string - format: date-time - x-nullable: true - enrollmentExpiresAt: - type: string - format: date-time - x-nullable: true - roleAttributes: - $ref: '#/definitions/attributes' - fingerprint: - type: string - versionInfo: - $ref: '#/definitions/versionInfo' - isTunnelerEnabled: - type: boolean - example: - id: b0766b8d-bd1a-4d28-8415-639b29d3c83d - createdAt: '2020-03-16T17:13:31.5807454Z' - updatedAt: '2020-03-16T17:13:31.5807454Z' - _links: - edge-router-policies: - href: "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d/edge-routers" - self: - href: "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d" - tags: { } - name: TestRouter-e33c837f-3222-4b40-bcd6-b3458fd5156e - fingerprint: - roleAttributes: - - eastCoast - - sales - - test - isVerified: false - isOnline: false - isTunnelerEnabled: false - enrollmentToken: 30a1f0ea-d39b-4aae-b852-304cf1c30d1f - enrollmentJwt: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImVyb3R0IiwiZXhwIjoxNTg0Mzc5MTExLCJpc3MiOiJodHRwczovL - 2xvY2FsaG9zdDoxMjgwIiwianRpIjoiMzBhMWYwZWEtZDM5Yi00YWFlLWI4NTItMzA0Y2YxYzMwZDFmIiwic3ViIjoiYjA3NjZiOGQtYmQxYS00ZDI - 4LTg0MTUtNjM5YjI5ZDNjODNkIn0.UsyQhCPORQ5tQnYWY7S88LNvV9iFS5Hy-P4aJaClZzEICobKgnQoyQblJcdMvk3cGKwyFqAnQtt0tDZkb8tHz - Vqyv6bilHcAFuMRrdwXRqdXquabSN5geu2qBUnyzL7Mf2X85if8sbMida6snB4oLZsVRF3CRn4ODBJdeiVJ_Z4rgD-zW2IwtXPApT7ALyiiw2cN4EH - 8pqQ7tpZKqztE0PGEbBQFPGKUFnm7oXyvSUo17EsFJUv5gUlBzfKKGolh5io4ptp22HZrqsqSnqDSOnYEZHonr5Yljuwiktrlh-JKiK6GGns5OAJMP - dO9lgM4yHSpF2ILbqhWMV93Y3zMOg' - enrollmentCreatedAt: '2020-03-16T17:13:31.5777637Z' - enrollmentExpiresAt: '2020-03-16T17:18:31.5777637Z' - hostname: '' - supportedProtocols: { } - ################################################################### - # Edge Router Policies - ################################################################## - edgeRouterPolicyCreate: - required: - - name - properties: - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - tags: - $ref: '#/definitions/tags' - edgeRouterPolicyUpdate: - required: - - name - properties: - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - tags: - $ref: '#/definitions/tags' - edgeRouterPolicyPatch: - properties: - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - tags: - $ref: '#/definitions/tags' - edgeRouterPolicyList: - type: array - items: - $ref: '#/definitions/edgeRouterPolicyDetail' - edgeRouterPolicyDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - semantic - - edgeRouterRoles - - edgeRouterRolesDisplay - - identityRoles - - identityRolesDisplay - - isSystem - properties: - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - edgeRouterRolesDisplay: - $ref: '#/definitions/namedRoles' - identityRoles: - $ref: '#/definitions/roles' - identityRolesDisplay: - $ref: '#/definitions/namedRoles' - isSystem: - type: boolean - ################################################################### - # Service Policies - ################################################################## - servicePolicyList: - type: array - items: - $ref: '#/definitions/servicePolicyDetail' - servicePolicyDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - type - - semantic - - serviceRoles - - serviceRolesDisplay - - identityRoles - - identityRolesDisplay - - postureCheckRoles - - postureCheckRolesDisplay - properties: - name: - type: string - type: - $ref: '#/definitions/dialBind' - semantic: - $ref: '#/definitions/semantic' - serviceRoles: - $ref: '#/definitions/roles' - serviceRolesDisplay: - $ref: '#/definitions/namedRoles' - identityRoles: - $ref: '#/definitions/roles' - identityRolesDisplay: - $ref: '#/definitions/namedRoles' - postureCheckRoles: - $ref: '#/definitions/roles' - postureCheckRolesDisplay: - $ref: '#/definitions/namedRoles' - servicePolicyCreate: - type: object - required: - - name - - type - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - type: - $ref: '#/definitions/dialBind' - semantic: - $ref: '#/definitions/semantic' - serviceRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - postureCheckRoles: - $ref: '#/definitions/roles' - servicePolicyUpdate: - type: object - required: - - name - - type - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - type: - $ref: '#/definitions/dialBind' - semantic: - $ref: '#/definitions/semantic' - serviceRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - postureCheckRoles: - $ref: '#/definitions/roles' - servicePolicyPatch: - type: object - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - type: - $ref: '#/definitions/dialBind' - semantic: - $ref: '#/definitions/semantic' - serviceRoles: - $ref: '#/definitions/roles' - identityRoles: - $ref: '#/definitions/roles' - postureCheckRoles: - $ref: '#/definitions/roles' - ################################################################### - # Services - ################################################################## - serviceList: - type: array - items: - $ref: '#/definitions/serviceDetail' - serviceDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - terminatorStrategy - - roleAttributes - - permissions - - configs - - config - - encryptionRequired - - postureQueries - properties: - name: - type: string - terminatorStrategy: - type: string - roleAttributes: - $ref: '#/definitions/attributes' - permissions: - $ref: '#/definitions/dialBindArray' - configs: - type: array - items: - type: string - config: - type: object - additionalProperties: - type: object - additionalProperties: - type: object - description: map of config data for this service keyed by the config type name. Only configs of the types requested will be returned. - encryptionRequired: - type: boolean - postureQueries: - type: array - items: - $ref: '#/definitions/postureQueries' - serviceCreate: - type: object - required: - - name - - encryptionRequired - properties: - name: - type: string - terminatorStrategy: - type: string - roleAttributes: - type: array - items: - type: string - configs: - type: array - items: - type: string - encryptionRequired: - type: boolean - tags: - $ref: '#/definitions/tags' - serviceUpdate: - type: object - required: - - name - properties: - name: - type: string - terminatorStrategy: - type: string - roleAttributes: - type: array - items: - type: string - configs: - type: array - items: - type: string - encryptionRequired: - type: boolean - tags: - $ref: '#/definitions/tags' - servicePatch: - type: object - properties: - name: - type: string - terminatorStrategy: - type: string - roleAttributes: - type: array - items: - type: string - configs: - type: array - items: - type: string - encryptionRequired: - type: boolean - tags: - $ref: '#/definitions/tags' - ################################################################### - # Geo Regions - ################################################################## - geoRegionList: - type: array - items: - $ref: '#/definitions/geoRegionDetail' - geoRegionDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - properties: - name: - type: string - ################################################################### - # Identity-Types - ################################################################## - identityTypeList: - type: array - items: - $ref: '#/definitions/identityDetail' - identityTypeDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - properties: - name: - type: string - ################################################################### - # Service Configs - ################################################################## - serviceConfigList: - type: array - items: - $ref: '#/definitions/serviceConfigDetail' - serviceConfigDetail: - type: object - required: - - serviceId - - service - - configId - - config - properties: - serviceId: - type: string - service: - $ref: '#/definitions/entityRef' - configId: - type: string - config: - $ref: '#/definitions/entityRef' - example: - service: - urlName: services - id: 913a8c63-17a6-44d7-82b3-9f6eb997cf8e - name: netcat4545-egress-r2 - _links: - self: - href: "./services/913a8c63-17a6-44d7-82b3-9f6eb997cf8e" - config: - urlName: configs - id: 13347602-ba34-4ff7-8082-e533ba945744 - name: test-config-02fade09-fcc3-426c-854e-18539726bdc6 - _links: - self: - href: "./identities/13347602-ba34-4ff7-8082-e533ba945744" - serviceConfigAssign: - type: object - required: - - serviceId - - configId - properties: - serviceId: - type: string - configId: - type: string - serviceConfigsAssignList: - type: array - items: - $ref: '#/definitions/serviceConfigAssign' - ################################################################### - # Service Edge Router Policies - ################################################################## - serviceEdgeRouterPolicyList: - type: array - items: - $ref: '#/definitions/serviceEdgeRouterPolicyDetail' - serviceEdgeRouterPolicyDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - semantic - - edgeRouterRoles - - edgeRouterRolesDisplay - - serviceRoles - - serviceRolesDisplay - properties: - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - edgeRouterRolesDisplay: - $ref: '#/definitions/namedRoles' - serviceRoles: - $ref: '#/definitions/roles' - serviceRolesDisplay: - $ref: '#/definitions/namedRoles' - serviceEdgeRouterPolicyCreate: - type: object - required: - - name - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - serviceRoles: - $ref: '#/definitions/roles' - serviceEdgeRouterPolicyUpdate: - type: object - required: - - name - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - serviceRoles: - $ref: '#/definitions/roles' - serviceEdgeRouterPolicyPatch: - type: object - properties: - tags: - $ref: '#/definitions/tags' - name: - type: string - semantic: - $ref: '#/definitions/semantic' - edgeRouterRoles: - $ref: '#/definitions/roles' - serviceRoles: - $ref: '#/definitions/roles' - ################################################################### - # Sessions - ################################################################## - sessionCreate: - type: object - properties: - serviceId: - type: string - type: - $ref: '#/definitions/dialBind' - tags: - $ref: '#/definitions/tags' - sessionList: - type: array - items: - $ref: '#/definitions/sessionDetail' - sessionRoutePathDetail: - type: object - properties: - routePath: - type: array - items: - type: string - sessionDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - type - - apiSessionId - - apiSession - - serviceId - - service - - token - - edgeRouters - properties: - type: - $ref: '#/definitions/dialBind' - token: - type: string - apiSessionId: - type: string - apiSession: - $ref: '#/definitions/entityRef' - serviceId: - type: string - service: - $ref: '#/definitions/entityRef' - edgeRouters: - type: array - items: - $ref: '#/definitions/sessionEdgeRouter' - sessionEdgeRouter: - allOf: - - $ref: "#/definitions/commonEdgeRouterProperties" - - type: object - required: - - urls - properties: - # deprecated property, see supportedProtocols in commonEdgeRouterProperties - urls: - type: object - additionalProperties: - type: string - commonEdgeRouterProperties: - type: object - required: - - hostname - - name - - supportedProtocols - - syncStatus - - isOnline - properties: - hostname: - type: string - name: - type: string - supportedProtocols: - additionalProperties: - type: string - type: object - syncStatus: - type: string - isOnline: - type: boolean - appData: - $ref: '#/definitions/tags' - ################################################################### - # Errors - ################################################################## - apiErrorEnvelope: - type: object - required: - - meta - - error - properties: - meta: - $ref: '#/definitions/meta' - error: - $ref: '#/definitions/apiError' - apiError: - type: object - properties: - args: - $ref: '#/definitions/apiErrorArgs' - data: - type: object - additionalProperties: true - causeMessage: - type: string - code: - type: string - message: - type: string - requestId: - type: string - cause: - $ref: '#/definitions/apiErrorCause' - apiFieldError: - type: object - properties: - reason: - type: string - field: - type: string - value: - type: string - apiErrorCause: - allOf: - - $ref: '#/definitions/apiFieldError' - - $ref: '#/definitions/apiError' - apiErrorArgs: - type: object - properties: - urlVars: - properties: { } - additionalProperties: - type: string - type: object - ################################################################### - # Standard - ################################################################## - empty: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - type: object - example: { } - meta: - type: object - properties: - filterableFields: - type: array - items: - type: string - x-omitempty: true - pagination: - $ref: '#/definitions/pagination' - apiEnrolmentVersion: - type: string - apiVersion: - type: string - createEnvelope: - type: object - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/createLocation' - createLocation: - type: object - properties: - _links: - $ref: '#/definitions/links' - id: - type: string - sessionCreateEnvelope: - type: object - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/sessionDetail' - enrollmentCertsEnvelope: - type: object - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/enrollmentCerts' - version: - type: object - properties: - 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' - apiVersions: - type: object - additionalProperties: - type: object - additionalProperties: - $ref: '#/definitions/apiVersion' - apiVersion: - type: object - required: - - path - properties: - version: - type: string - path: - type: string - protocol: - type: object - required: - - address - properties: - address: - type: string - listSummaryCounts: - type: object - additionalProperties: - type: integer - listProtocols: - type: object - additionalProperties: - $ref: '#/definitions/protocol' - enrollmentCerts: - type: object - properties: - serverCert: - type: string - description: A PEM encoded set of certificates to use as the servers chain - cert: - type: string - description: A PEM encoded cert for the server - ca: - type: string - description: A PEM encoded set of CA certificates to trust - currentAPISessionDetailEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/currentApiSessionDetail' - currentIdentityDetailEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/identityDetail' - listAPISessionsEnvelope: - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/apiSessionList' - listCurrentAPISessionCertificatesEnvelope: - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/currentApiSessionCertificateList' - createCurrentApiSessionCertificateEnvelope: - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/currentApiSessionCertificateCreateResponse' - detailCurrentApiSessionCertificateEnvelope: - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/currentApiSessionCertificateDetail' - detailAPISessionEnvelope: - required: - - meta - - data - type: object - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/apiSessionDetail' - listAuthenticatorsEnvelope: - type: object - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/authenticatorList' - detailAuthenticatorEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/authenticatorDetail' - listCasEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/caList' - detailCaEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/caDetail' - listConfigTypesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/configTypeList' - detailConfigTypeEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/configTypeDetail' - listConfigsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/configList' - detailConfigEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/configDetail' - listVersionEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/version' - listSummaryCountsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/listSummaryCounts' - listProtocolsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/listProtocols' - listEnrollmentsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/enrollmentList' - detailEnrollmentEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/enrollmentDetail' - listCurrentIdentityEdgeRoutersEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/currentIdentityEdgeRouterList' - listEdgeRoutersEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/edgeRouterList' - detailedEdgeRouterEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/edgeRouterDetail' - listEdgeRouterPoliciesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/edgeRouterPolicyList' - detailEdgeRouterPolicyEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/edgeRouterPolicyDetail' - listServicePoliciesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/servicePolicyList' - detailServicePolicyEnvelop: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/servicePolicyDetail' - listServicesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/serviceList' - detailServiceEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/serviceDetail' - listIdentitiesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/identityList' - detailIdentityEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/identityDetail' - listGeoRegionsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/geoRegionList' - detailGeoRegionEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/geoRegionDetail' - listIdentityTypesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/identityTypeList' - detailIdentityTypeEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/identityTypeDetail' - listServiceConfigsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/serviceConfigList' - listServiceEdgeRouterPoliciesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/serviceEdgeRouterPolicyList' - detailServiceEdgePolicyEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/serviceEdgeRouterPolicyDetail' - listSessionsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/sessionList' - detailSessionEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/sessionDetail' - detailSessionRoutePathEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/sessionRoutePathDetail' - envInfo: - description: Environment information an authenticating client may provide - properties: - os: - type: string - arch: - type: string - osRelease: - type: string - osVersion: - type: string - type: object - sdkInfo: - description: SDK information an authenticating client may provide - properties: - type: - type: string - branch: - type: string - version: - type: string - revision: - type: string - appId: - type: string - appVersion: - type: string - type: object - configTypes: - description: Specific configuration types that should be returned - type: array - items: - type: string - pagination: - type: object - required: - - limit - - offset - - totalCount - properties: - limit: - type: number - format: int64 - offset: - type: number - format: int64 - totalCount: - type: number - format: int64 - ################################################################### - # Terminators - ################################################################## - listTerminatorsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/terminatorList' - detailTerminatorEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/terminatorDetail' - terminatorList: - type: array - items: - $ref: '#/definitions/terminatorDetail' - terminatorDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - serviceId - - service - - routerId - - router - - binding - - address - - identity - - cost - - precedence - - dynamicCost - properties: - serviceId: - type: string - service: - $ref: '#/definitions/entityRef' - routerId: - type: string - router: - $ref: '#/definitions/entityRef' - binding: - type: string - address: - type: string - identity: - type: string - cost: - $ref: '#/definitions/terminatorCost' - precedence: - $ref: '#/definitions/terminatorPrecedence' - dynamicCost: - $ref: '#/definitions/terminatorCost' - terminatorDetailLimited: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - serviceId - - service - - routerId - - identity - properties: - serviceId: - type: string - service: - $ref: '#/definitions/entityRef' - routerId: - type: string - identity: - type: string - - terminatorCreate: - type: object - required: - - service - - router - - address - - binding - properties: - service: - type: string - router: - type: string - binding: - type: string - address: - type: string - identity: - type: string - identitySecret: - type: string - format: byte - cost: - $ref: '#/definitions/terminatorCost' - precedence: - $ref: '#/definitions/terminatorPrecedence' - tags: - $ref: '#/definitions/tags' - terminatorUpdate: - type: object - required: - - service - - router - - address - - binding - properties: - service: - type: string - router: - type: string - binding: - type: string - address: - type: string - cost: - $ref: '#/definitions/terminatorCost' - precedence: - $ref: '#/definitions/terminatorPrecedence' - tags: - $ref: '#/definitions/tags' - terminatorPatch: - type: object - properties: - service: - type: string - router: - type: string - binding: - type: string - address: - type: string - cost: - $ref: '#/definitions/terminatorCost' - precedence: - $ref: '#/definitions/terminatorPrecedence' - tags: - $ref: '#/definitions/tags' - ################################################################### - # Specs - ################################################################## - listSpecsEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/specList' - detailSpecEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/specDetail' - detailSpecBodyEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/specBodyDetail' - specList: - type: array - items: - $ref: '#/definitions/specDetail' - specDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - properties: - name: - type: string - specBodyDetail: - type: string - - listRoleAttributesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/roleAttributesList' - - roleAttributesList: - description: An array of role attributes - type: array - items: - type: string - - getIdentityPolicyAdviceEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/policyAdvice' - - policyAdvice: - type: "object" - properties: - identityId: - type: "string" - identity: - $ref: '#/definitions/entityRef' - serviceId: - type: "string" - service: - $ref: '#/definitions/entityRef' - isBindAllowed: - type: "boolean" - isDialAllowed: - type: "boolean" - identityRouterCount: - type: "number" - format: int32 - serviceRouterCount: - type: "number" - format: int32 - commonRouters: - type: "array" - items: - $ref: '#/definitions/routerEntityRef' - - routerEntityRef: - type: object - allOf: - - $ref: '#/definitions/entityRef' - - type: object - required: - - isOnline - properties: - isOnline: - type: boolean - - ################################################################### - # Transit Routers - ################################################################## - listTransitRoutersEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/transitRouterList' - detailTransitRouterEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/transitRouterDetail' - transitRouterList: - type: array - items: - $ref: '#/definitions/transitRouterDetail' - transitRouterDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - name - - isVerified - - isOnline - - fingerprint - properties: - name: - type: string - fingerprint: - type: string - isVerified: - type: boolean - isOnline: - type: boolean - enrollmentToken: - type: string - x-nullable: true - enrollmentJwt: - type: string - x-nullable: true - enrollmentCreatedAt: - type: string - format: date-time - x-nullable: true - enrollmentExpiresAt: - type: string - format: date-time - x-nullable: true - transitRouterCreate: - type: object - required: - - name - properties: - name: - type: string - tags: - $ref: '#/definitions/tags' - transitRouterUpdate: - type: object - required: - - name - properties: - name: - type: string - tags: - $ref: '#/definitions/tags' - transitRouterPatch: - type: object - properties: - name: - type: string - tags: - $ref: '#/definitions/tags' - terminatorCost: - type: integer - minimum: 0 - maximum: 65535 - terminatorPrecedence: - type: string - enum: - - default - - required - - failed - terminatorPrecedenceMap: - type: object - additionalProperties: - $ref: '#/definitions/terminatorPrecedence' - terminatorCostMap: - type: object - additionalProperties: - $ref: '#/definitions/terminatorCost' - dataIntegrityCheckResultEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/dataIntegrityCheckDetails' - dataIntegrityCheckDetails: - type: object - required: - - inProgress - - fixingErrors - - tooManyErrors - - startTime - - endTime - - error - - results - properties: - inProgress: - type: boolean - startTime: - type: string - format: date-time - endTime: - type: string - format: date-time - fixingErrors: - type: boolean - error: - type: string - tooManyErrors: - type: boolean - results: - $ref: '#/definitions/dataIntegrityCheckDetailList' - dataIntegrityCheckDetailList: - type: array - items: - $ref: '#/definitions/dataIntegrityCheckDetail' - dataIntegrityCheckDetail: - type: object - required: - - description - - fixed - properties: - description: - type: string - fixed: - type: boolean - - ################################################################### - # Posture Data - ################################################################## - getIdentityFailedServiceRequestEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/failedServiceRequestList' - - getIdentityPostureDataEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/postureData' - - postureDataBase: - type: object - required: - - postureCheckId - - timedOut - - lastUpdatedAt - properties: - postureCheckId: - type: string - timedOut: - type: boolean - lastUpdatedAt: - type: string - format: date-time - - postureDataMac: - type: object - allOf: - - $ref: '#/definitions/postureDataBase' - - type: object - required: - - addresses - properties: - addresses: - type: array - items: - type: string - - postureDataDomain: - type: object - allOf: - - $ref: '#/definitions/postureDataBase' - - type: object - required: - - domain - properties: - domain: - type: string - - postureDataOs: - type: object - allOf: - - $ref: '#/definitions/postureDataBase' - - type: object - required: - - type - - version - - build - properties: - type: - type: string - version: - type: string - build: - type: string - - postureDataProcess: - type: object - allOf: - - $ref: '#/definitions/postureDataBase' - - type: object - properties: - isRunning: - type: boolean - binaryHash: - type: string - signerFingerprints: - type: array - items: - type: string - - postureDataMfa: - type: object - required: - - apiSessionId - - passedMfa - properties: - apiSessionId: - type: string - passedMfa: - type: boolean - - apiSessionPostureData: - type: object - required: - - mfa - properties: - mfa: - $ref: '#/definitions/postureDataMfa' - - postureCheckFailure: - type: object - discriminator: postureCheckType - required: - - postureCheckId - - postureCheckName - - postureCheckType - properties: - postureCheckId: - type: string - postureCheckName: - type: string - postureCheckType: - type: string - - postureCheckFailureMacAddress: - x-class: MAC - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - properties: - actualValue: - type: array - items: - type: string - expectedValue: - type: array - items: - type: string - - postureCheckFailureDomain: - x-class: DOMAIN - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - properties: - actualValue: - type: string - expectedValue: - type: array - items: - type: string - postureCheckFailureOperatingSystemActual: - type: object - required: - - type - - version - properties: - type: - type: string - version: - type: string - - postureCheckFailureOperatingSystem: - x-class: OS - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - properties: - actualValue: - $ref: '#/definitions/postureCheckFailureOperatingSystemActual' - expectedValue: - type: array - minItems: 1 - items: - $ref: '#/definitions/operatingSystem' - - postureCheckFailureProcessActual: - type: object - required: - - isRunning - - hash - - signerFingerprints - properties: - path: - type: string - isRunning: - type: boolean - hash: - type: string - signerFingerprints: - type: array - items: - type: string - osType: - $ref: '#/definitions/osType' - - postureCheckFailureProcess: - x-class: PROCESS - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - properties: - actualValue: - $ref: '#/definitions/postureCheckFailureProcessActual' - expectedValue: - $ref: '#/definitions/process' - - postureCheckFailureProcessMulti: - x-class: PROCESS_MULTI - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - - semantic - properties: - semantic: - $ref: '#/definitions/semantic' - actualValue: - type: array - items: - $ref: '#/definitions/postureCheckFailureProcessActual' - expectedValue: - type: array - items: - $ref: '#/definitions/processMulti' - - postureCheckFailureMfa: - x-class: MFA - allOf: - - $ref: '#/definitions/postureCheckFailure' - - type: object - required: - - actualValue - - expectedValue - properties: - actualValue: - type: boolean - expectedValue: - type: boolean - - policyFailure: - type: object - properties: - policyId: - type: string - policyName: - type: string - checks: - type: array - items: - $ref: '#/definitions/postureCheckFailure' - - failedSessionRequest: - type: object - properties: - apiSessionId: - type: string - when: - type: string - format: date-time - serviceId: - type: string - serviceName: - type: string - sessionType: - $ref: '#/definitions/dialBind' - policyFailures: - type: array - items: - $ref: '#/definitions/policyFailure' - - postureData: - type: object - required: - - mac - - domain - - os - - processes - - apiSessionPostureData - properties: - mac: - $ref: '#/definitions/postureDataMac' - domain: - $ref: '#/definitions/postureDataDomain' - os: - $ref: '#/definitions/postureDataOs' - processes: - type: array - items: - $ref: '#/definitions/postureDataProcess' - apiSessionPostureData: - type: object - additionalProperties: - $ref: '#/definitions/apiSessionPostureData' - - failedServiceRequestList: - type: array - items: - $ref: '#/definitions/failedSessionRequest' - - ################################################################### - # Posture Query - ################################################################## - postureQueries: - type: object - required: - - policyId - - isPassing - - postureQueries - properties: - policyId: - type: string - isPassing: - type: boolean - policyType: - $ref: '#/definitions/dialBind' - postureQueries: - type: array - items: - $ref: '#/definitions/postureQuery' - postureQuery: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - queryType - - isPassing - - timeout - properties: - isPassing: - type: boolean - timeout: - type: integer - queryType: - $ref: '#/definitions/postureCheckType' - process: - $ref: '#/definitions/postureQueryProcess' - processes: - type: array - items: - $ref: '#/definitions/postureQueryProcess' - postureQueryProcess: - type: object - properties: - osType: - $ref: '#/definitions/osType' - path: - type: string - ################################################################### - # Posture Check Types - ################################################################## - listPostureCheckTypesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/PostureCheckTypeList' - detailPostureCheckTypeEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/PostureCheckTypeDetail' - PostureCheckTypeList: - type: array - items: - $ref: '#/definitions/PostureCheckTypeDetail' - 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 - - ################################################################### - # Posture Check - ################################################################## - listPostureCheckEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - #can't use PostureCheckList as it will cause issues w/ the code generation as of 3/2021 - type: array - items: - $ref: '#/definitions/PostureCheckDetail' - detailPostureCheckEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/PostureCheckDetail' - PostureCheckDetail: - type: object - discriminator: typeId - # base is duped here due to a bug in go-swagger that will try to embed a struct in an interface - # see https://github.com/go-swagger/go-swagger/issues/2413 - required: - - name - - typeId - - version - - roleAttributes - - id - - createdAt - - updatedAt - - _links - - tags - properties: - name: - type: string - typeId: - type: string - version: - type: integer - roleAttributes: - $ref: '#/definitions/attributes' - id: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - _links: - $ref: '#/definitions/links' - tags: - $ref: '#/definitions/tags' - PostureCheckCreate: - type: object - discriminator: typeId - required: - - name - - typeId - properties: - name: - type: string - typeId: - $ref: '#/definitions/postureCheckType' - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - PostureCheckUpdate: - type: object - discriminator: typeId - required: - - name - properties: - name: - type: string - typeId: - $ref: '#/definitions/postureCheckType' - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - PostureCheckPatch: - type: object - discriminator: typeId - properties: - name: - type: string - roleAttributes: - $ref: '#/definitions/attributes' - tags: - $ref: '#/definitions/tags' - - ################################################################### - # Posture Check Operating System - ################################################################### - PostureCheckOperatingSystemDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - - type: object - required: - - operatingSystems - properties: - operatingSystems: - type: array - items: - $ref: '#/definitions/operatingSystem' - x-class: "OS" - - PostureCheckOperatingSystemCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - - type: object - required: - - operatingSystems - 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" - PostureCheckOperatingSystemPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - - type: object - properties: - operatingSystems: - type: array - minItems: 1 - items: - $ref: '#/definitions/operatingSystem' - x-class: "OS" - - ################################################################### - # Posture Check Domain - ################################################################### - PostureCheckDomainDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - - type: object - required: - - domains - properties: - domains: - type: array - minItems: 1 - items: - type: string - x-class: "DOMAIN" - - PostureCheckDomainCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - - type: object - required: - - domains - 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" - - PostureCheckDomainPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - - type: object - properties: - domains: - type: array - minItems: 1 - items: - type: string - x-class: "DOMAIN" - - ################################################################### - # Posture Check MAC Address - ################################################################### - PostureCheckMacAddressDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - - type: object - required: - - macAddresses - properties: - macAddresses: - type: array - minItems: 1 - items: - type: string - - x-class: "MAC" - - PostureCheckMacAddressCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - - type: object - required: - - macAddresses - 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" - - PostureCheckMacAddressPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - - type: object - properties: - macAddresses: - type: array - minItems: 1 - items: - type: string - x-class: "MAC" - - ################################################################### - # Posture Check Process - ################################################################### - PostureCheckProcessDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - - type: object - required: - - process - properties: - process: - $ref: '#/definitions/process' - x-class: "PROCESS" - - PostureCheckProcessCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - - type: object - required: - - process - 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" - - PostureCheckProcessPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - - type: object - properties: - process: - $ref: '#/definitions/process' - x-class: "PROCESS" - - ################################################################### - # Posture Check Process Multi - ################################################################### - PostureCheckProcessMultiDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - - type: object - required: - - semantic - - processes - properties: - semantic: - $ref: '#/definitions/semantic' - processes: - type: array - minItems: 1 - items: - $ref: '#/definitions/processMulti' - x-class: "PROCESS_MULTI" - - PostureCheckProcessMultiCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - - type: object - required: - - semantic - - processes - properties: - semantic: - $ref: '#/definitions/semantic' - processes: - type: array - minItems: 1 - items: - $ref: '#/definitions/processMulti' - x-class: "PROCESS_MULTI" - - PostureCheckProcessMultiUpdate: - allOf: - - $ref: '#/definitions/PostureCheckUpdate' - - type: object - required: - - semantic - - processes - properties: - semantic: - $ref: '#/definitions/semantic' - processes: - type: array - minItems: 1 - items: - $ref: '#/definitions/processMulti' - x-class: "PROCESS_MULTI" - - PostureCheckProcessMultiPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - - type: object - properties: - semantic: - $ref: '#/definitions/semantic' - processes: - type: array - minItems: 1 - items: - $ref: '#/definitions/processMulti' - x-class: "PROCESS_MULTI" - - ################################################################### - # Posture Check MFA - ################################################################### - PostureCheckMfaDetail: - allOf: - - $ref: '#/definitions/PostureCheckDetail' - x-class: "MFA" - - PostureCheckMfaCreate: - allOf: - - $ref: '#/definitions/PostureCheckCreate' - x-class: "MFA" - - PostureCheckMfaUpdate: - allOf: - - $ref: '#/definitions/PostureCheckUpdate' - x-class: "MFA" - - PostureCheckMfaPatch: - allOf: - - $ref: '#/definitions/PostureCheckPatch' - x-class: "MFA" - - ################################################################### - # Posture Response - ################################################################### - PostureResponseCreate: - type: object - discriminator: typeId - required: - - id - - typeId - properties: - id: - type: string - typeId: - $ref: '#/definitions/postureCheckType' - - PostureResponseOperatingSystemCreate: - allOf: - - $ref: '#/definitions/PostureResponseCreate' - - type: object - required: - - type - - version - properties: - type: - type: string - version: - type: string - build: - type: string - x-class: "OS" - - PostureResponseDomainCreate: - allOf: - - $ref: '#/definitions/PostureResponseCreate' - - type: object - required: - - domain - properties: - domain: - type: string - x-class: "DOMAIN" - - PostureResponseMacAddressCreate: - allOf: - - $ref: '#/definitions/PostureResponseCreate' - - type: object - required: - - macAddresses - properties: - macAddresses: - type: array - items: - type: string - x-class: "MAC" - - PostureResponseProcessCreate: - allOf: - - $ref: '#/definitions/PostureResponseCreate' - - type: object - required: - - path - - isRunning - - hash - - signerFingerprints - properties: - path: - type: string - isRunning: - type: boolean - hash: - type: string - signerFingerprints: - type: array - items: - type: string - x-class: "PROCESS" - - ################################################################### - # Authentication Checks - ################################################################### - authQueryList: - type: array - items: - $ref: '#/definitions/authQueryDetail' - authQueryDetail: - type: object - required: - - provider - properties: - typeId: - type: string - provider: - $ref: '#/definitions/mfaProviders' - httpMethod: - type: string - httpUrl: - type: string - minLength: - type: integer - maxLength: - type: integer - format: - $ref: '#/definitions/mfaFormats' - - mfaFormats: - type: string - enum: - - numeric - - alpha - - alphaNumeric - mfaProviders: - type: string - enum: - - ziti - ################################################################### - # Current API Session: Certificates - ################################################################### - currentApiSessionCertificateList: - type: array - items: - $ref: '#/definitions/currentApiSessionCertificateDetail' - currentApiSessionCertificateDetail: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - type: object - required: - - subject - - fingerprint - - validFrom - - validTo - - certificate - properties: - subject: - type: string - fingerprint: - type: string - validFrom: - type: string - format: date-time - validTo: - type: string - format: date-time - certificate: - type: string - currentApiSessionCertificateCreate: - type: object - required: - - csr - properties: - csr: - type: string - currentApiSessionCertificateCreateResponse: - allOf: - - $ref: '#/definitions/createLocation' - - type: object - required: - - certificate - properties: - certificate: - type: string - cas: - type: string - - ################################################################### - # Current Identity: MFA - ################################################################### - mfaCreatedEnvelope: - type: object - required: - - meta - - error - properties: - meta: - $ref: '#/definitions/meta' - error: - $ref: '#/definitions/apiError' - detailMfaEnvelope: - type: object - required: - - meta - - error - properties: - meta: - $ref: '#/definitions/meta' - error: - $ref: '#/definitions/detailMfa' - detailMfa: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - required: - - isVerified - properties: - isVerified: - type: boolean - recoveryCodes: - type: array - items: - type: string - description: Not provided if MFA verification has been completed - provisioningUrl: - type: string - description: Not provided if MFA verification has been completed - detailMfaRecoveryCodesEnvelope: - type: object - required: - - meta - - error - properties: - meta: - $ref: '#/definitions/meta' - error: - $ref: '#/definitions/detailMfaRecoveryCodes' - detailMfaRecoveryCodes: - type: object - allOf: - - $ref: '#/definitions/baseEntity' - - required: - - recoveryCodes - properties: - recoveryCodes: - type: array - items: - type: string - mfaCode: - type: object - required: - - code - properties: - code: - type: string - ################################################################### - # Current API Session: Service Updates - ################################################################## - listCurrentApiSessionServiceUpdatesEnvelope: - type: object - required: - - meta - - data - properties: - meta: - $ref: '#/definitions/meta' - data: - $ref: '#/definitions/CurrentApiSessionServiceUpdateList' - CurrentApiSessionServiceUpdateList: - type: object - required: - - lastChangeAt - properties: - lastChangeAt: - type: string - format: 'date-time' - - ################################################################### - # Enrollment/Reenrollment - ################################################################## - routerExtendEnrollmentRequest: - type: object - required: - - serverCertCsr - - certCsr - properties: - serverCertCsr: - type: string - certCsr: - type: string